Fix redownload logic

--redownload was reversed and redownloaded the deps instead of the
targets.
This commit is contained in:
morganamilo 2018-09-04 18:23:05 +01:00
parent bbeaf5bc6e
commit 2b6a73041f
No known key found for this signature in database
GPG key ID: 6FE9E7996B0B082E

View file

@ -796,14 +796,16 @@ func pkgbuildsToSkip(bases []Base, targets stringSet) stringSet {
isTarget = isTarget || targets.get(pkg.Name)
}
if config.ReDownload == "no" || (config.ReDownload == "yes" && isTarget) {
dir := filepath.Join(config.BuildDir, base.Pkgbase(), ".SRCINFO")
pkgbuild, err := gosrc.ParseFile(dir)
if (config.ReDownload == "yes" && isTarget) || config.ReDownload == "all" {
continue
}
if err == nil {
if alpm.VerCmp(pkgbuild.Version(), base.Version()) >= 0 {
toSkip.set(base.Pkgbase())
}
dir := filepath.Join(config.BuildDir, base.Pkgbase(), ".SRCINFO")
pkgbuild, err := gosrc.ParseFile(dir)
if err == nil {
if alpm.VerCmp(pkgbuild.Version(), base.Version()) >= 0 {
toSkip.set(base.Pkgbase())
}
}
}