Add replaces field to package information

This commit is contained in:
2025-03-15 11:20:33 +02:00
parent 4f9d2cdecd
commit e94b2a8816
4 changed files with 62 additions and 6 deletions
+17
View File
@@ -167,6 +167,23 @@ func GetRepositoryEntry(str string) (*RepositoryEntry, *Repository, error) {
}
}
func FindReplacement(pkg string) *RepositoryEntry {
for _, repo := range BPMConfig.Repositories {
for _, entry := range repo.Entries {
if entry.IsVirtualPackage {
continue
}
for _, replaced := range entry.Info.Replaces {
if replaced == pkg {
return entry
}
}
}
}
return nil
}
func (repo *Repository) FetchPackage(pkg string) (string, error) {
if !repo.ContainsPackage(pkg) {
return "", errors.New("could not fetch package '" + pkg + "'")