diff options
author | Dmitry Marakasov <amdmi3@amdmi3.ru> | 2024-10-24 00:44:41 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2024-10-24 21:46:02 +0300 |
commit | ef0a0c649bf8e20100708f237d7195b58e61b526 (patch) | |
tree | a9349139cfc0aea8c9caa50b22912901284d72aa /pkg/portage | |
parent | node: update depepdencies (diff) | |
download | soko-master.tar.gz soko-master.tar.bz2 soko-master.zip |
This is more correct as srcname for Gentoo in repology is derived from
atom, while visiblename can be arbitrary string which identifies a
package.
Closes: https://github.com/gentoo/soko/pull/32
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'pkg/portage')
-rw-r--r-- | pkg/portage/repology/outdated.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/pkg/portage/repology/outdated.go b/pkg/portage/repology/outdated.go index 4237072..fa5822b 100644 --- a/pkg/portage/repology/outdated.go +++ b/pkg/portage/repology/outdated.go @@ -22,7 +22,7 @@ import ( type Package struct { Repo string `json:"repo"` Name string `json:"name"` - VisibleName string `json:"visiblename"` + SrcName string `json:"srcname"` Version string `json:"version"` Status string `json:"status"` } @@ -128,29 +128,29 @@ func (o *outdatedCheck) getOutdatedStartingWith(letter rune) { gentooPackages := make(map[string]struct{}) for _, v := range repoPackages[packagename] { if v.Repo == "gentoo" { - gentooPackages[v.VisibleName] = struct{}{} + gentooPackages[v.SrcName] = struct{}{} } } mainLoop: for _, v := range repoPackages[packagename] { - category, _, _ := strings.Cut(v.VisibleName, "/") + category, _, _ := strings.Cut(v.SrcName, "/") if v.Repo == "gentoo" { if v.Status == "newest" { - outdated[v.VisibleName] = false + outdated[v.SrcName] = false } else if v.Status == "outdated" { - if contains(o.blockedCategories, category) || o.atomRules[v.VisibleName].isIgnored(v.Version, v.Repo) { + if contains(o.blockedCategories, category) || o.atomRules[v.SrcName].isIgnored(v.Version, v.Repo) { continue } - if _, found := outdated[v.VisibleName]; !found { - outdated[v.VisibleName] = true + if _, found := outdated[v.SrcName]; !found { + outdated[v.SrcName] = true } - if latest, found := currentVersion[v.VisibleName]; found { + if latest, found := currentVersion[v.SrcName]; found { current := models.Version{Version: v.Version} if current.GreaterThan(models.Version{Version: latest}) { - currentVersion[v.VisibleName] = v.Version + currentVersion[v.SrcName] = v.Version } } else { - currentVersion[v.VisibleName] = v.Version + currentVersion[v.SrcName] = v.Version } } } else if len(newestVersion) == 0 && v.Status == "newest" && !contains(o.blockedRepos, v.Repo) { |