mirror of
https://github.com/Jguer/yay.git
synced 2024-11-06 17:17:22 +01:00
Merge pull request #643 from Morganamilo/cleanmenu
Only print the clean number menu when needed
This commit is contained in:
commit
ebc4ef1c33
27
install.go
27
install.go
@ -175,13 +175,15 @@ func install(parser *arguments) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if config.CleanMenu {
|
if config.CleanMenu {
|
||||||
askClean := pkgbuildNumberMenu(do.Aur, remoteNamesCache)
|
if anyExistInCache(do.Aur) {
|
||||||
toClean, err := cleanNumberMenu(do.Aur, remoteNamesCache, askClean)
|
askClean := pkgbuildNumberMenu(do.Aur, remoteNamesCache)
|
||||||
if err != nil {
|
toClean, err := cleanNumberMenu(do.Aur, remoteNamesCache, askClean)
|
||||||
return err
|
if err != nil {
|
||||||
}
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
cleanBuilds(toClean)
|
cleanBuilds(toClean)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toSkip := pkgbuildsToSkip(do.Aur, targets)
|
toSkip := pkgbuildsToSkip(do.Aur, targets)
|
||||||
@ -485,6 +487,19 @@ func parsePackageList(dir string) (map[string]string, string, error) {
|
|||||||
return pkgdests, version, nil
|
return pkgdests, version, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func anyExistInCache(bases []Base) bool {
|
||||||
|
for _, base := range bases {
|
||||||
|
pkg := base.Pkgbase()
|
||||||
|
dir := filepath.Join(config.BuildDir, pkg)
|
||||||
|
|
||||||
|
if _, err := os.Stat(dir); !os.IsNotExist(err) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func pkgbuildNumberMenu(bases []Base, installed stringSet) bool {
|
func pkgbuildNumberMenu(bases []Base, installed stringSet) bool {
|
||||||
toPrint := ""
|
toPrint := ""
|
||||||
askClean := false
|
askClean := false
|
||||||
|
Loading…
Reference in New Issue
Block a user