From 550474f7909a28feb683ddebcf06fb357821540e Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Sun, 7 Mar 2021 15:30:01 +0300 Subject: [PATCH] add ignore_pacakges option, switch to pkgbase everywhere --- CONFIGURING.md | 1 + package/etc/ahriman.ini | 1 + src/ahriman/core/repository.py | 4 ++++ src/ahriman/models/package.py | 4 ++-- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CONFIGURING.md b/CONFIGURING.md index 3588d362..d347e74d 100644 --- a/CONFIGURING.md +++ b/CONFIGURING.md @@ -21,6 +21,7 @@ Build related configuration. Group name must refer to architecture, e.g. it shou * `archbuild_flags` - additional flags passed to `archbuild` command, space separated list of strings, optional. * `build_command` - default build command, string, required. +* `ignore_packages` - list packages to ignore during a regular update (manual update will still work), space separated list of strings, optional. * `makepkg_flags` - additional flags passed to `makepkg` command, space separated list of strings, optional. * `makechrootpkg_flags` - additional flags passed to `makechrootpkg` command, space separated list of strings, optional. diff --git a/package/etc/ahriman.ini b/package/etc/ahriman.ini index 284f1942..e2435581 100644 --- a/package/etc/ahriman.ini +++ b/package/etc/ahriman.ini @@ -8,6 +8,7 @@ url = https://aur.archlinux.org [build_x86_64] archbuild_flags = build_command = extra-x86_64-build +ignore_packages = makechrootpkg_flags = makepkg_flags = --skippgpcheck diff --git a/src/ahriman/core/repository.py b/src/ahriman/core/repository.py index aa92d101..737ab453 100644 --- a/src/ahriman/core/repository.py +++ b/src/ahriman/core/repository.py @@ -144,6 +144,8 @@ class Repository: def updates_aur(self, checked: List[str]) -> List[Package]: result: List[Package] = [] + ignore_list = self.config.get_list( + self.config.get_section_name('build', self.architecture), 'ignore_packages') for fn in os.listdir(self.paths.repository): if '.pkg.' not in fn: @@ -157,6 +159,8 @@ class Repository: continue if local.name in checked: continue + if local.name in ignore_list: + continue if local.is_outdated(remote): result.append(remote) diff --git a/src/ahriman/models/package.py b/src/ahriman/models/package.py index e62d0bf8..50255669 100644 --- a/src/ahriman/models/package.py +++ b/src/ahriman/models/package.py @@ -39,13 +39,13 @@ class Package: @classmethod def from_archive(cls: Type[Package], path: str, aur_url: str) -> Package: - name, version = check_output('expac', '-p', '%n %v', path, exception=None).split() + name, version = check_output('expac', '-p', '%e %v', path, exception=None).split() return cls(name, version, f'{aur_url}/{name}.git') @classmethod def from_aur(cls: Type[Package], name: str, aur_url: str)-> Package: package = aur.info(name) - return cls(package.name, package.version, f'{aur_url}/{name}.git') + return cls(package.package_base, package.version, f'{aur_url}/{package.package_base}.git') @classmethod def from_build(cls: Type[Package], path: str) -> Package: