Skip to content

Commit

Permalink
Merge pull request Jguer#642 from Morganamilo/needed
Browse files Browse the repository at this point in the history
 skip build when package is up to date and --needed
  • Loading branch information
Morganamilo authored Aug 18, 2018
2 parents 024fefe + aca65e7 commit 23ff1e7
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions install.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ func parsePackageList(dir string) (map[string]string, string, error) {
// This assumes 3 dashes after the pkgname, Will cause an error
// if the PKGEXT contains a dash. Please no one do that.
pkgname := strings.Join(split[:len(split)-3], "-")
version = strings.Join(split[len(split)-3:len(split)-2], "-")
version = strings.Join(split[len(split)-3:len(split)-1], "-")
pkgdests[pkgname] = line
}

Expand Down Expand Up @@ -946,9 +946,23 @@ func buildInstallPkgbuilds(dp *depPool, do *depOrder, srcinfos map[string]*gosrc
built = false
}

if cmdArgs.existsArg("needed") {
installed := true
for _, split := range base {
if alpmpkg, err := dp.LocalDb.PkgByName(split.Name); err != nil || alpmpkg.Version() != version {
installed = false
}
}

if installed {
fmt.Println(cyan(pkg+"-"+version) + bold(" is up to date -- skipping"))
continue
}
}

if built {
fmt.Println(bold(yellow(arrow)),
cyan(pkg+"-"+version)+bold(" Already made -- skipping build"))
cyan(pkg+"-"+version)+bold(" already made -- skipping build"))
} else {
args := []string{"-cf", "--noconfirm", "--noextract", "--noprepare", "--holdver"}

Expand Down

0 comments on commit 23ff1e7

Please sign in to comment.