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
()
| 59 | return &res |
| 60 | } |
| 61 | |
| 62 | // Repo returns package's dbpackage.Repository |
| 63 | func (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 |
| 69 | func (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 |
| 75 | func (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 |
| 81 | func (pkg Package) Arch() *string { |
| 82 | fNameSplit := strings.Split(filepath.Base(string(pkg)), "-") |