Compare commits

..

2 Commits

Author SHA1 Message Date
2c913afb7a Release 2.19.3 2026-01-25 10:46:24 +02:00
65bcf819b1 fix: fallback to package name for missing bases in archive
package zoom is being generated without base, leading to None there

Closes #155
2026-01-25 10:45:56 +02:00
5 changed files with 22 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
pkgbase='ahriman' pkgbase='ahriman'
pkgname=('ahriman' 'ahriman-core' 'ahriman-triggers' 'ahriman-web') pkgname=('ahriman' 'ahriman-core' 'ahriman-triggers' 'ahriman-web')
pkgver=2.19.2 pkgver=2.19.3
pkgrel=1 pkgrel=1
pkgdesc="ArcH linux ReposItory MANager" pkgdesc="ArcH linux ReposItory MANager"
arch=('any') arch=('any')

View File

@@ -1,4 +1,4 @@
.TH AHRIMAN "1" "2026\-01\-25" "ahriman 2.19.2" "ArcH linux ReposItory MANager" .TH AHRIMAN "1" "2026\-01\-25" "ahriman 2.19.3" "ArcH linux ReposItory MANager"
.SH NAME .SH NAME
ahriman \- ArcH linux ReposItory MANager ahriman \- ArcH linux ReposItory MANager
.SH SYNOPSIS .SH SYNOPSIS

View File

@@ -17,4 +17,4 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
__version__ = "2.19.2" __version__ = "2.19.3"

View File

@@ -205,7 +205,7 @@ class Package(LazyLogging):
package = pacman.handle.load_pkg(str(path)) package = pacman.handle.load_pkg(str(path))
description = PackageDescription.from_package(package, path) description = PackageDescription.from_package(package, path)
return cls( return cls(
base=package.base, base=package.base or package.name,
version=package.version, version=package.version,
remote=RemoteSource(source=PackageSource.Archive), remote=RemoteSource(source=PackageSource.Archive),
packages={package.name: description}, packages={package.name: description},

View File

@@ -2,7 +2,7 @@ import copy
from pathlib import Path from pathlib import Path
from pytest_mock import MockerFixture from pytest_mock import MockerFixture
from unittest.mock import MagicMock, call as MockCall from unittest.mock import MagicMock, PropertyMock, call as MockCall
from ahriman.core.alpm.pacman import Pacman from ahriman.core.alpm.pacman import Pacman
from ahriman.core.configuration import Configuration from ahriman.core.configuration import Configuration
@@ -163,6 +163,23 @@ def test_from_archive(package_ahriman: Package, pyalpm_handle: MagicMock, mocker
assert generated == package_ahriman assert generated == package_ahriman
def test_from_archive_empty_base(package_ahriman: Package, pyalpm_package_ahriman: MagicMock,
mocker: MockerFixture) -> None:
"""
must construct package with empty base from alpm library
"""
pyalpm_handle = MagicMock()
type(pyalpm_package_ahriman).base = PropertyMock(return_value=None)
pyalpm_handle.handle.load_pkg.return_value = pyalpm_package_ahriman
mocker.patch("ahriman.models.package_description.PackageDescription.from_package",
return_value=package_ahriman.packages[package_ahriman.base])
generated = Package.from_archive(Path("path"), pyalpm_handle)
generated.remote = package_ahriman.remote
assert generated == package_ahriman
def test_from_aur(package_ahriman: Package, aur_package_ahriman: AURPackage, mocker: MockerFixture) -> None: def test_from_aur(package_ahriman: Package, aur_package_ahriman: AURPackage, mocker: MockerFixture) -> None:
""" """
must construct package from aur must construct package from aur