2017-08-27 18:18:23 +02:00
|
|
|
// Package linux contains functions that are useful to generate linux packages.
|
|
|
|
package linux
|
|
|
|
|
|
|
|
import "strings"
|
|
|
|
|
|
|
|
// Arch converts a goarch to a linux-compatible arch
|
|
|
|
func Arch(key string) string {
|
|
|
|
switch {
|
|
|
|
case strings.Contains(key, "amd64"):
|
|
|
|
return "amd64"
|
|
|
|
case strings.Contains(key, "386"):
|
|
|
|
return "i386"
|
|
|
|
case strings.Contains(key, "arm64"):
|
|
|
|
return "arm64"
|
|
|
|
case strings.Contains(key, "arm6"):
|
2018-04-13 21:59:38 +02:00
|
|
|
return "armel"
|
|
|
|
case strings.Contains(key, "arm7"):
|
2017-08-27 18:18:23 +02:00
|
|
|
return "armhf"
|
2019-03-20 02:02:12 +02:00
|
|
|
case strings.Contains(key, "ppc64le"):
|
|
|
|
return "ppc64le"
|
|
|
|
case strings.Contains(key, "ppc64"):
|
|
|
|
return "ppc64"
|
2017-08-27 18:18:23 +02:00
|
|
|
}
|
|
|
|
return key
|
|
|
|
}
|