From 7a823c50d898a547c79f780f5913c23beadb713f Mon Sep 17 00:00:00 2001 From: Maxim Baz Date: Sun, 11 Jun 2017 22:50:39 +0200 Subject: [PATCH] Use pkgName to search for saved package info URL is not a unique identifier. Multiple installed packages can refer to the same github URL, like `alacritty-git` and `alacritty-terminfo-git`. The search must be thus based on the package name. --- aur/vcs/github.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aur/vcs/github.go b/aur/vcs/github.go index 4329d858..e4d58751 100644 --- a/aur/vcs/github.go +++ b/aur/vcs/github.go @@ -119,9 +119,9 @@ func CheckUpdates(foreign map[string]alpm.Package) (toUpdate []string) { return } -func inStore(url string) *Info { +func inStore(pkgName string) *Info { for i, e := range savedInfo { - if url == e.URL { + if pkgName == e.Package { return &savedInfo[i] } } @@ -156,7 +156,7 @@ func BranchInfo(pkgName string, owner string, repo string) (err error) { _ = json.NewDecoder(r.Body).Decode(&newRepo) - packinfo := inStore(url) + packinfo := inStore(pkgName) for _, e := range newRepo { if e.Name == "master" {