mirror of
https://github.com/Jguer/yay.git
synced 2024-11-06 09:07:21 +01:00
skip build when package is up to date and --needed
Before --needed was left purerly to pacman. The problem with this is that if a package is not in the cache, it will end up being build just for pacman to skip over the install. Now Yay will handle this and skip the build and install if --needed is used. The inital clone and pkgver bumb is still donw.
This commit is contained in:
parent
19bf8e773c
commit
907bf3a30e
16
install.go
16
install.go
@ -931,9 +931,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