package arch

import "github.com/purpleidea/mgmt/util/arch"

Package arch is for utilities that deal with cpu architectures. Best to keep these all in one place so that adding this data happens all in the same file.

Index

Constants

const (
	// Any is a special value meaning noarch or any arch.
	Any = "*"
)

Variables

var (
	// MapPackageKitArchToGoArch contains the mapping from PackageKit arch
	// to GOARCH.
	MapPackageKitArchToGoArch = map[string]string{

		"noarch": Any,
		"any":    Any,
		"all":    Any,

		"x86_64":  "amd64",
		"aarch64": "arm64",

		"amd64": "amd64",
		"arm64": "arm64",
		"i386":  "386",
		"i486":  "386",
		"i586":  "386",
		"i686":  "386",
	}

	// MapGoArchToVirtBuilderArch is a map of GOARCH to virt-builder format.
	MapGoArchToVirtBuilderArch = map[string]string{

		"386":   "i686",
		"amd64": "x86_64",

		"arm64": "aarch64",
	}
)

Functions

func GoArchToVirtBuilderArch

func GoArchToVirtBuilderArch(goarch string) (string, bool)

GoArchToVirtBuilderArch returns the virt-builder arch corresponding to the golang GOARCH value. This returns false if the value doesn't exist.

Source Files

arch.go

Version
v0.0.0-20250322185616-c50a578426f1 (latest)
Published
Mar 22, 2025
Platform
linux/amd64
Last checked
4 days ago

Tools for package owners.