Support "noarch" style packages in arch check

Forgot about these :)
This commit is contained in:
James Shubin
2016-03-14 04:15:29 -04:00
parent 2ab6d61a61
commit 50c458b6cc

View File

@@ -49,6 +49,8 @@ var (
// GOARCH's: 386, amd64, arm, arm64, mips64, mips64le, ppc64, ppc64le // GOARCH's: 386, amd64, arm, arm64, mips64, mips64le, ppc64, ppc64le
PkArchMap = map[string]string{ // map of PackageKit arch to GOARCH PkArchMap = map[string]string{ // map of PackageKit arch to GOARCH
// TODO: add more values // TODO: add more values
// noarch
"noarch": "ANY", // special value "ANY"
// fedora // fedora
"x86_64": "amd64", "x86_64": "amd64",
"aarch64": "arm64", "aarch64": "arm64",
@@ -834,5 +836,8 @@ func IsMyArch(arch string) bool {
// if you get this error, please update the PkArchMap const // if you get this error, please update the PkArchMap const
log.Fatalf("PackageKit: Arch '%v', not found!", arch) log.Fatalf("PackageKit: Arch '%v', not found!", arch)
} }
if goarch == "ANY" { // special value that corresponds to noarch
return true
}
return goarch == runtime.GOARCH return goarch == runtime.GOARCH
} }