mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 15:27:17 +00:00
fix: do not treat cached vcs packages as local
This commit is contained in:
parent
a396126a79
commit
7a3d32dcfa
@ -153,6 +153,8 @@ class UpdateHandler(PackageInfo, Cleaner):
|
|||||||
local = packages.get(remote.base)
|
local = packages.get(remote.base)
|
||||||
if local is None:
|
if local is None:
|
||||||
continue # we don't add packages automatically
|
continue # we don't add packages automatically
|
||||||
|
if local.remote.is_remote:
|
||||||
|
continue # avoid checking AUR packages
|
||||||
|
|
||||||
if 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,
|
||||||
|
@ -212,6 +212,7 @@ def test_updates_local(update_handler: UpdateHandler, package_ahriman: Package,
|
|||||||
"""
|
"""
|
||||||
must check for updates for locally stored packages
|
must check for updates for locally stored packages
|
||||||
"""
|
"""
|
||||||
|
package_ahriman.remote = RemoteSource(source=PackageSource.Local, git_url="", web_url="", path="", branch="")
|
||||||
mocker.patch("ahriman.core.repository.update_handler.UpdateHandler.packages", return_value=[package_ahriman])
|
mocker.patch("ahriman.core.repository.update_handler.UpdateHandler.packages", return_value=[package_ahriman])
|
||||||
mocker.patch("pathlib.Path.iterdir", return_value=[Path(package_ahriman.base)])
|
mocker.patch("pathlib.Path.iterdir", return_value=[Path(package_ahriman.base)])
|
||||||
fetch_mock = mocker.patch("ahriman.core.build_tools.sources.Sources.fetch")
|
fetch_mock = mocker.patch("ahriman.core.build_tools.sources.Sources.fetch")
|
||||||
@ -237,6 +238,7 @@ def test_updates_local_ignore_vcs(update_handler: UpdateHandler, package_ahriman
|
|||||||
"""
|
"""
|
||||||
must skip VCS packages check if requested for locally stored packages
|
must skip VCS packages check if requested for locally stored packages
|
||||||
"""
|
"""
|
||||||
|
package_ahriman.remote = RemoteSource(source=PackageSource.Local, git_url="", web_url="", path="", branch="")
|
||||||
mocker.patch("ahriman.core.repository.update_handler.UpdateHandler.packages", return_value=[package_ahriman])
|
mocker.patch("ahriman.core.repository.update_handler.UpdateHandler.packages", return_value=[package_ahriman])
|
||||||
mocker.patch("pathlib.Path.iterdir", return_value=[Path(package_ahriman.base)])
|
mocker.patch("pathlib.Path.iterdir", return_value=[Path(package_ahriman.base)])
|
||||||
mocker.patch("ahriman.core.build_tools.sources.Sources.fetch")
|
mocker.patch("ahriman.core.build_tools.sources.Sources.fetch")
|
||||||
@ -263,6 +265,19 @@ def test_updates_local_unknown(update_handler: UpdateHandler, package_ahriman: P
|
|||||||
assert update_handler.updates_local(vcs=True) == []
|
assert update_handler.updates_local(vcs=True) == []
|
||||||
|
|
||||||
|
|
||||||
|
def test_updates_local_remote(update_handler: UpdateHandler, package_ahriman: Package, mocker: MockerFixture) -> None:
|
||||||
|
"""
|
||||||
|
must skip packages with remote source
|
||||||
|
"""
|
||||||
|
mocker.patch("ahriman.core.repository.update_handler.UpdateHandler.packages", return_value=[package_ahriman])
|
||||||
|
mocker.patch("pathlib.Path.iterdir", return_value=[Path(package_ahriman.base)])
|
||||||
|
mocker.patch("ahriman.models.package.Package.is_outdated", return_value=True)
|
||||||
|
mocker.patch("ahriman.core.build_tools.sources.Sources.fetch")
|
||||||
|
mocker.patch("ahriman.models.package.Package.from_build", return_value=package_ahriman)
|
||||||
|
|
||||||
|
assert update_handler.updates_local(vcs=True) == []
|
||||||
|
|
||||||
|
|
||||||
def test_updates_local_with_failures(update_handler: UpdateHandler, package_ahriman: Package,
|
def test_updates_local_with_failures(update_handler: UpdateHandler, package_ahriman: Package,
|
||||||
mocker: MockerFixture) -> None:
|
mocker: MockerFixture) -> None:
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user