Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
14e853c793 | |||
a69ebec802 |
13
main.go
13
main.go
@@ -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{
|
||||
|
Reference in New Issue
Block a user