MCPcopy Create free account
hub / github.com/an0nfunc/ALHP / HasValidSignature

Method HasValidSignature

package.go:61–79  ·  view source on GitHub ↗

HasValidSignature returns if package has valid detached signature file. Signatures made with a now-expired key (EXPKEYSIG) or with an expired signature timestamp (EXPSIG) are reported invalid even though gpg exits 0 for them. KEYEXPIRED is intentionally not matched because GnuPG may emit it for unre

()

Source from the content-addressed store, hash-verified

59 return &res
60}
61
62// Repo returns package's dbpackage.Repository
63func (pkg Package) Repo() dbpackage.Repository {
64 splitPath := strings.Split(string(pkg), string(filepath.Separator))
65 return dbpackage.Repository(strings.Split(splitPath[len(splitPath)-4], "-")[0])
66}
67
68// FullRepo returns package's dbpackage.Repository-march
69func (pkg Package) FullRepo() *string {
70 splitPath := strings.Split(string(pkg), string(filepath.Separator))
71 return &splitPath[len(splitPath)-4]
72}
73
74// Version returns version extracted from package
75func (pkg Package) Version() string {
76 fNameSplit := strings.Split(filepath.Base(string(pkg)), "-")
77 return strings.Join(fNameSplit[len(fNameSplit)-3:len(fNameSplit)-1], "-")
78}
79
80// Arch returns package's Architecture
81func (pkg Package) Arch() *string {
82 fNameSplit := strings.Split(filepath.Base(string(pkg)), "-")

Callers 1

housekeepingFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected