mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-08-22 09:29:56 +00:00
use generic packages tree for all repos
This commit is contained in:
@ -95,7 +95,6 @@ class TreeMigrate(Handler):
|
|||||||
"""
|
"""
|
||||||
# we don't care about devtools chroot
|
# we don't care about devtools chroot
|
||||||
for attribute in (
|
for attribute in (
|
||||||
RepositoryPaths.archive,
|
|
||||||
RepositoryPaths.packages,
|
RepositoryPaths.packages,
|
||||||
RepositoryPaths.pacman,
|
RepositoryPaths.pacman,
|
||||||
RepositoryPaths.repository,
|
RepositoryPaths.repository,
|
||||||
|
@ -52,7 +52,7 @@ def migrate_data(connection: Connection, configuration: Configuration) -> None:
|
|||||||
|
|
||||||
# create archive directory if required
|
# create archive directory if required
|
||||||
if not paths.archive.is_dir():
|
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)
|
paths.archive.mkdir(mode=0o755, parents=True)
|
||||||
|
|
||||||
move_packages(paths, pacman)
|
move_packages(paths, pacman)
|
||||||
|
@ -93,7 +93,7 @@ class RepositoryPaths(LazyLogging):
|
|||||||
Returns:
|
Returns:
|
||||||
Path: archive directory root
|
Path: archive directory root
|
||||||
"""
|
"""
|
||||||
return self.root / "archive" / self._suffix
|
return self.root / "archive"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def build_root(self) -> Path:
|
def build_root(self) -> Path:
|
||||||
@ -309,6 +309,7 @@ class RepositoryPaths(LazyLogging):
|
|||||||
path = path or self.root
|
path = path or self.root
|
||||||
|
|
||||||
def walk(root: Path) -> Generator[Path, None, None]:
|
def walk(root: Path) -> Generator[Path, None, None]:
|
||||||
|
yield root
|
||||||
if not root.exists():
|
if not root.exists():
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -69,7 +69,6 @@ def test_move_tree(mocker: MockerFixture) -> None:
|
|||||||
|
|
||||||
TreeMigrate.tree_move(from_paths, to_paths)
|
TreeMigrate.tree_move(from_paths, to_paths)
|
||||||
rename_mock.assert_has_calls([
|
rename_mock.assert_has_calls([
|
||||||
MockCall(from_paths.archive, to_paths.archive),
|
|
||||||
MockCall(from_paths.packages, to_paths.packages),
|
MockCall(from_paths.packages, to_paths.packages),
|
||||||
MockCall(from_paths.pacman, to_paths.pacman),
|
MockCall(from_paths.pacman, to_paths.pacman),
|
||||||
MockCall(from_paths.repository, to_paths.repository),
|
MockCall(from_paths.repository, to_paths.repository),
|
||||||
|
Reference in New Issue
Block a user