mirror of
				https://github.com/arcan1s/ahriman.git
				synced 2025-10-30 21:33:43 +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 | ||||
|  | ||||
|         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) | ||||
|         patch = PkgbuildPatch("arch", list(architectures)) | ||||
|         patch.write(pkgbuild_path) | ||||
|  | ||||
| @ -23,6 +23,18 @@ def test_extend_architectures(mocker: MockerFixture) -> None: | ||||
|     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: | ||||
|     """ | ||||
|     must skip extending list of the architectures in case if no PKGBUILD file found | ||||
|  | ||||
		Reference in New Issue
	
	Block a user