Explorar o código

Fix redownload logic

--redownload was reversed and redownloaded the deps instead of the
targets.
morganamilo %!s(int64=6) %!d(string=hai) anos
pai
achega
2b6a73041f
Modificáronse 1 ficheiros con 9 adicións e 7 borrados
  1. 9 7
      install.go

+ 9 - 7
install.go

@@ -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())
 			}
 		}
 	}