mirror of
				https://github.com/arcan1s/ahriman.git
				synced 2025-10-31 05:43:41 +00:00 
			
		
		
		
	skip architecture list patching in case if any architecture is set
This commit is contained in:
		| @ -57,6 +57,8 @@ class Sources(LazyLogging): | |||||||
|             return |             return | ||||||
|  |  | ||||||
|         architectures = Package.supported_architectures(sources_dir) |         architectures = Package.supported_architectures(sources_dir) | ||||||
|  |         if "any" in architectures:  # makepkg does not like when there is any other arch except for any | ||||||
|  |             return | ||||||
|         architectures.add(architecture) |         architectures.add(architecture) | ||||||
|         patch = PkgbuildPatch("arch", list(architectures)) |         patch = PkgbuildPatch("arch", list(architectures)) | ||||||
|         patch.write(pkgbuild_path) |         patch.write(pkgbuild_path) | ||||||
|  | |||||||
| @ -23,6 +23,18 @@ def test_extend_architectures(mocker: MockerFixture) -> None: | |||||||
|     write_mock.assert_called_once_with(Path("local") / "PKGBUILD") |     write_mock.assert_called_once_with(Path("local") / "PKGBUILD") | ||||||
|  |  | ||||||
|  |  | ||||||
|  | def test_extend_architectures_any(mocker: MockerFixture) -> None: | ||||||
|  |     """ | ||||||
|  |     must skip architecture patching in case if there is any architecture | ||||||
|  |     """ | ||||||
|  |     mocker.patch("pathlib.Path.is_file", return_value=True) | ||||||
|  |     mocker.patch("ahriman.models.package.Package.supported_architectures", return_value={"any"}) | ||||||
|  |     write_mock = mocker.patch("ahriman.models.pkgbuild_patch.PkgbuildPatch.write") | ||||||
|  |  | ||||||
|  |     Sources.extend_architectures(Path("local"), "i686") | ||||||
|  |     write_mock.assert_not_called() | ||||||
|  |  | ||||||
|  |  | ||||||
| def test_extend_architectures_skip(mocker: MockerFixture) -> None: | def test_extend_architectures_skip(mocker: MockerFixture) -> None: | ||||||
|     """ |     """ | ||||||
|     must skip extending list of the architectures in case if no PKGBUILD file found |     must skip extending list of the architectures in case if no PKGBUILD file found | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user