Skip to content

Commit

Permalink
mantle/system: Add RpmArch API
Browse files Browse the repository at this point in the history
A lot of our code uses the portage architecture, which no longer
makes sense.  Now, the more correct code for this is part of
rpm-ostree but I'm not sure we want to go to forking off that yet.
Since the build system only supports this set of architectures
currently, let's just inline the Go -> RPM translation here.
  • Loading branch information
cgwalters authored and openshift-merge-robot committed Mar 19, 2020
1 parent c17b6c2 commit 86966cc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions mantle/system/arch.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,27 @@
package system

import (
"fmt"
"runtime"
)

// RpmArch returns the architecture in RPM terms.
func RpmArch() string {
goarch := runtime.GOARCH
switch goarch {
case "amd64":
return "x86_64"
case "arm64":
return "aarch64"
case "ppc64":
return "ppc64le"
case "s390x":
return "s390x"
default:
panic(fmt.Sprintf("RpmArch: No mapping defined for GOARCH %s", goarch))
}
}

func PortageArch() string {
arch := runtime.GOARCH
switch arch {
Expand Down

0 comments on commit 86966cc

Please sign in to comment.