Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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