2 Commits
1.0.5 ... main

Author SHA1 Message Date
14e853c793 fix len condition 2025-04-20 19:14:42 +02:00
a69ebec802 fix url path join 2025-04-20 18:21:51 +02:00

13
main.go
View File

@@ -9,6 +9,7 @@ import (
log "github.com/sirupsen/logrus"
"io"
"net/http"
"net/url"
"os"
"path"
"regexp"
@@ -93,8 +94,14 @@ func main() {
continue
}
log.Debugf("checking mirror %s (%s)", repo.Servers[0], path.Join(repo.Servers[0], "../../../lastupdate"))
resp, err := http.Get(path.Join(repo.Servers[0], "../../../lastupdate"))
pURL, err := url.Parse(repo.Servers[0])
if err != nil {
log.Warnf("error parsing mirror url: %v", err)
}
pURL.Path = path.Join(pURL.Path, "../../../lastupdate")
log.Debugf("checking mirror %s (%s)", repo.Servers[0], pURL.String())
resp, err := http.Get(pURL.String())
if err != nil {
log.Warnf("error getting mirror lastupdate: %v", err)
continue
@@ -122,7 +129,7 @@ func main() {
}
}
if len(packagesInQueue) == 0 {
if len(packagesInQueue) > 0 {
log.Debugf("found %d of your local packages in queue", len(packagesInQueue))
if *jsonFlag {
err = json.NewEncoder(os.Stdout).Encode(JSONOut{