diff --git a/src/ahriman/application/handlers/tree_migrate.py b/src/ahriman/application/handlers/tree_migrate.py index 9672f75c..b41b4678 100644 --- a/src/ahriman/application/handlers/tree_migrate.py +++ b/src/ahriman/application/handlers/tree_migrate.py @@ -95,7 +95,6 @@ class TreeMigrate(Handler): """ # we don't care about devtools chroot for attribute in ( - RepositoryPaths.archive, RepositoryPaths.packages, RepositoryPaths.pacman, RepositoryPaths.repository, diff --git a/src/ahriman/core/database/migrations/m016_archive.py b/src/ahriman/core/database/migrations/m016_archive.py index fa6a064f..2510f4c2 100644 --- a/src/ahriman/core/database/migrations/m016_archive.py +++ b/src/ahriman/core/database/migrations/m016_archive.py @@ -52,7 +52,7 @@ def migrate_data(connection: Connection, configuration: Configuration) -> None: # create archive directory if required if not paths.archive.is_dir(): - with paths.preserve_owner(paths.root / "archive"): + with paths.preserve_owner(paths.archive): paths.archive.mkdir(mode=0o755, parents=True) move_packages(paths, pacman) diff --git a/src/ahriman/models/repository_paths.py b/src/ahriman/models/repository_paths.py index b4f42cc1..108cf9f9 100644 --- a/src/ahriman/models/repository_paths.py +++ b/src/ahriman/models/repository_paths.py @@ -93,7 +93,7 @@ class RepositoryPaths(LazyLogging): Returns: Path: archive directory root """ - return self.root / "archive" / self._suffix + return self.root / "archive" @property def build_root(self) -> Path: @@ -309,6 +309,7 @@ class RepositoryPaths(LazyLogging): path = path or self.root def walk(root: Path) -> Generator[Path, None, None]: + yield root if not root.exists(): return diff --git a/tests/ahriman/application/handlers/test_handler_tree_migrate.py b/tests/ahriman/application/handlers/test_handler_tree_migrate.py index 3f161f8e..1c223ed6 100644 --- a/tests/ahriman/application/handlers/test_handler_tree_migrate.py +++ b/tests/ahriman/application/handlers/test_handler_tree_migrate.py @@ -69,7 +69,6 @@ def test_move_tree(mocker: MockerFixture) -> None: TreeMigrate.tree_move(from_paths, to_paths) rename_mock.assert_has_calls([ - MockCall(from_paths.archive, to_paths.archive), MockCall(from_paths.packages, to_paths.packages), MockCall(from_paths.pacman, to_paths.pacman), MockCall(from_paths.repository, to_paths.repository),