mirror of
https://github.com/Jguer/yay.git
synced 2024-11-06 09:07:21 +01:00
Merge pull request #642 from Morganamilo/needed
skip build when package is up to date and --needed
This commit is contained in:
commit
23ff1e79df
18
install.go
18
install.go
@ -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
|
||||
}
|
||||
|
||||
@ -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"}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user