mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-04-07 11:03:37 +00:00
fix rebase
This commit is contained in:
@@ -125,7 +125,7 @@ class ArchiveTree(LazyLogging):
|
|||||||
if root.exists():
|
if root.exists():
|
||||||
return
|
return
|
||||||
|
|
||||||
with self.paths.preserve_owner(self.paths.archive):
|
with self.paths.preserve_owner():
|
||||||
root.mkdir(0o755, parents=True)
|
root.mkdir(0o755, parents=True)
|
||||||
# init empty repository here
|
# init empty repository here
|
||||||
Repo(self.repository_id.name, self.paths, self.sign_args, root).init()
|
Repo(self.repository_id.name, self.paths, self.sign_args, root).init()
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ __all__ = [
|
|||||||
"safe_filename",
|
"safe_filename",
|
||||||
"srcinfo_property",
|
"srcinfo_property",
|
||||||
"srcinfo_property_list",
|
"srcinfo_property_list",
|
||||||
|
"symlink_relative",
|
||||||
"trim_package",
|
"trim_package",
|
||||||
"utcnow",
|
"utcnow",
|
||||||
"walk",
|
"walk",
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ def test_tree_create(archive_tree: ArchiveTree, mocker: MockerFixture) -> None:
|
|||||||
init_mock = mocker.patch("ahriman.core.alpm.repo.Repo.init")
|
init_mock = mocker.patch("ahriman.core.alpm.repo.Repo.init")
|
||||||
|
|
||||||
archive_tree.tree_create()
|
archive_tree.tree_create()
|
||||||
owner_guard_mock.assert_called_once_with(archive_tree.paths.archive)
|
owner_guard_mock.assert_called_once_with()
|
||||||
mkdir_mock.assert_called_once_with(0o755, parents=True)
|
mkdir_mock.assert_called_once_with(0o755, parents=True)
|
||||||
init_mock.assert_called_once_with()
|
init_mock.assert_called_once_with()
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ def test_archive_for_create_tree(repository_paths: RepositoryPaths, package_ahri
|
|||||||
mkdir_mock = mocker.patch("pathlib.Path.mkdir")
|
mkdir_mock = mocker.patch("pathlib.Path.mkdir")
|
||||||
|
|
||||||
repository_paths.archive_for(package_ahriman.base)
|
repository_paths.archive_for(package_ahriman.base)
|
||||||
owner_mock.assert_called_once_with(repository_paths.archive)
|
owner_mock.assert_called_once_with()
|
||||||
mkdir_mock.assert_called_once_with(mode=0o755, parents=True)
|
mkdir_mock.assert_called_once_with(mode=0o755, parents=True)
|
||||||
|
|
||||||
|
|
||||||
@@ -265,18 +265,6 @@ def test_preserve_owner_non_root(tmp_path: Path, repository_id: RepositoryId, mo
|
|||||||
setegid_mock.assert_not_called()
|
setegid_mock.assert_not_called()
|
||||||
|
|
||||||
|
|
||||||
def test_preserve_owner_no_directory(tmp_path: Path, repository_id: RepositoryId, mocker: MockerFixture) -> None:
|
|
||||||
"""
|
|
||||||
must skip directory scan if it does not exist
|
|
||||||
"""
|
|
||||||
repository_paths = RepositoryPaths(tmp_path, repository_id)
|
|
||||||
chown_mock = mocker.patch("ahriman.models.repository_paths.RepositoryPaths._chown")
|
|
||||||
|
|
||||||
with repository_paths.preserve_owner(Path("empty")):
|
|
||||||
(repository_paths.root / "created1").touch()
|
|
||||||
chown_mock.assert_not_called()
|
|
||||||
|
|
||||||
|
|
||||||
def test_tree_clear(repository_paths: RepositoryPaths, package_ahriman: Package, mocker: MockerFixture) -> None:
|
def test_tree_clear(repository_paths: RepositoryPaths, package_ahriman: Package, mocker: MockerFixture) -> None:
|
||||||
"""
|
"""
|
||||||
must remove any package related files
|
must remove any package related files
|
||||||
|
|||||||
Reference in New Issue
Block a user