Skip to content

Commit

Permalink
Fix redownload logic
Browse files Browse the repository at this point in the history
--redownload was reversed and redownloaded the deps instead of the
targets.
  • Loading branch information
Morganamilo committed Sep 4, 2018
1 parent bbeaf5b commit 2b6a730
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
}
Expand Down

0 comments on commit 2b6a730

Please sign in to comment.