write .makepkg.conf to home dir instead of repository root (#72)

This commit is contained in:
2022-11-08 16:44:48 +02:00
parent 82b932371b
commit b3b3cad706
3 changed files with 27 additions and 4 deletions

View File

@ -20,6 +20,7 @@
import argparse
from pathlib import Path
from pwd import getpwuid
from typing import Type
from ahriman.application.application import Application
@ -173,7 +174,9 @@ class Setup(Handler):
packager(str): packager identifier (e.g. name, email)
paths(RepositoryPaths): repository paths instance
"""
(paths.root / ".makepkg.conf").write_text(f"PACKAGER='{packager}'\n", encoding="utf8")
uid, _ = paths.root_owner
home_dir = Path(getpwuid(uid).pw_dir)
(home_dir / ".makepkg.conf").write_text(f"PACKAGER='{packager}'\n", encoding="utf8")
@staticmethod
def configuration_create_sudo(paths: RepositoryPaths, prefix: str, architecture: str) -> None: