2 Commits
1.0.5 ... 1.0.7

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