mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 15:27:17 +00:00
fix: do not automatically add unknown local packages
Instead of automatic package addition now it is required to add package manually after clone. Less magic, plus would allow to use caches for multi-repo setup (see #109)
This commit is contained in:
parent
4c1d0abb85
commit
45eba6a6e3
@ -96,14 +96,16 @@ class Task(LazyLogging):
|
|||||||
cwd=sources_dir,
|
cwd=sources_dir,
|
||||||
logger=self.logger,
|
logger=self.logger,
|
||||||
user=self.uid,
|
user=self.uid,
|
||||||
environment=environment)
|
environment=environment,
|
||||||
|
)
|
||||||
|
|
||||||
# well it is not actually correct, but we can deal with it
|
# well it is not actually correct, but we can deal with it
|
||||||
packages = Task._check_output(
|
packages = Task._check_output(
|
||||||
"makepkg", "--packagelist",
|
"makepkg", "--packagelist",
|
||||||
exception=BuildError.from_process(self.package.base),
|
exception=BuildError.from_process(self.package.base),
|
||||||
cwd=sources_dir,
|
cwd=sources_dir,
|
||||||
logger=self.logger
|
logger=self.logger,
|
||||||
|
environment=environment,
|
||||||
).splitlines()
|
).splitlines()
|
||||||
return [Path(package) for package in packages]
|
return [Path(package) for package in packages]
|
||||||
|
|
||||||
|
@ -123,9 +123,9 @@ class UpdateHandler(Cleaner):
|
|||||||
|
|
||||||
local = packages.get(remote.base)
|
local = packages.get(remote.base)
|
||||||
if local is None:
|
if local is None:
|
||||||
self.reporter.set_unknown(remote)
|
continue # we don't add packages automatically
|
||||||
result.append(remote)
|
|
||||||
elif local.is_outdated(remote, self.paths,
|
if local.is_outdated(remote, self.paths,
|
||||||
vcs_allowed_age=self.vcs_allowed_age,
|
vcs_allowed_age=self.vcs_allowed_age,
|
||||||
calculate_version=vcs):
|
calculate_version=vcs):
|
||||||
self.reporter.set_pending(local.base)
|
self.reporter.set_pending(local.base)
|
||||||
|
@ -199,10 +199,8 @@ def test_updates_local_unknown(update_handler: UpdateHandler, package_ahriman: P
|
|||||||
mocker.patch("ahriman.models.package.Package.is_outdated", return_value=True)
|
mocker.patch("ahriman.models.package.Package.is_outdated", return_value=True)
|
||||||
mocker.patch("ahriman.core.build_tools.sources.Sources.fetch")
|
mocker.patch("ahriman.core.build_tools.sources.Sources.fetch")
|
||||||
mocker.patch("ahriman.models.package.Package.from_build", return_value=package_ahriman)
|
mocker.patch("ahriman.models.package.Package.from_build", return_value=package_ahriman)
|
||||||
status_client_mock = mocker.patch("ahriman.core.status.client.Client.set_unknown")
|
|
||||||
|
|
||||||
assert update_handler.updates_local(vcs=True) == [package_ahriman]
|
assert update_handler.updates_local(vcs=True) == []
|
||||||
status_client_mock.assert_called_once_with(package_ahriman)
|
|
||||||
|
|
||||||
|
|
||||||
def test_updates_local_with_failures(update_handler: UpdateHandler, package_ahriman: Package,
|
def test_updates_local_with_failures(update_handler: UpdateHandler, package_ahriman: Package,
|
||||||
|
Loading…
Reference in New Issue
Block a user