mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
add support for distro detection
Signed-off-by: Alfredo Deza <adeza@anchore.com>
This commit is contained in:
parent
f1851556a8
commit
56c2318ea1
@ -3,41 +3,46 @@ package distro
|
||||
const (
|
||||
UnknownDistro Type = iota
|
||||
Debian
|
||||
// Ubuntu
|
||||
// RedHat
|
||||
// CentOS
|
||||
Ubuntu
|
||||
RedHat
|
||||
CentOS
|
||||
// Fedora
|
||||
// Alpine
|
||||
// Busybox
|
||||
Busybox
|
||||
// AmazonLinux
|
||||
// OracleLinux
|
||||
// ArchLinux
|
||||
)
|
||||
|
||||
const (
|
||||
// UnknownVersion is a default of 0.0.0 when it can't be parsed
|
||||
UnknownVersion string = "0.0.0"
|
||||
)
|
||||
|
||||
type Type int
|
||||
|
||||
var distroStr = []string{
|
||||
"UnknownDistro",
|
||||
"Debian",
|
||||
// "Ubuntu",
|
||||
// "RedHat",
|
||||
// "CentOS",
|
||||
// "Fedora",
|
||||
// "Alpine",
|
||||
// "Busybox",
|
||||
// "AmazonLinux",
|
||||
// "OracleLinux",
|
||||
// "ArchLinux",
|
||||
"debian",
|
||||
"ubuntu",
|
||||
"redhat",
|
||||
"centos",
|
||||
// "fedora",
|
||||
// "alpine",
|
||||
"busybox",
|
||||
// "amazn",
|
||||
// "oraclelinux",
|
||||
// "archlinux",
|
||||
}
|
||||
|
||||
var All = []Type{
|
||||
Debian,
|
||||
// Ubuntu,
|
||||
// RedHat,
|
||||
// CentOS,
|
||||
Ubuntu,
|
||||
RedHat,
|
||||
CentOS,
|
||||
// Fedora,
|
||||
// Alpine,
|
||||
// Busybox,
|
||||
Busybox,
|
||||
// AmazonLinux,
|
||||
// OracleLinux,
|
||||
// ArchLinux,
|
||||
@ -50,3 +55,17 @@ func (t Type) String() string {
|
||||
|
||||
return distroStr[t]
|
||||
}
|
||||
|
||||
// Mappings connects a distro ID like "ubuntu" to a Distro type
|
||||
var Mappings = map[string]Type{
|
||||
"debian": Debian,
|
||||
"ubuntu": Ubuntu,
|
||||
"rhel": RedHat,
|
||||
"centos": CentOS,
|
||||
// "fedora": Fedora,
|
||||
// "alpine": Alpine,
|
||||
"busybox": Busybox,
|
||||
// "amazn": AmazonLinux,
|
||||
// "oraclelinux": OracleLinux,
|
||||
// "archlinux": ArchLinux,
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user