Fix redownload logic

--redownload was reversed and redownloaded the deps instead of the
targets.
This commit is contained in:
morganamilo committed 2018-09-04 19:39:15 +01:00
1 parent bbeaf5bc6e
commit 2b6a73041f
1 file changed
+9 -7
+9 -7
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())
}
}
}