From 2ea16836eb1b27531032ca46eb8f0773ceb96689 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Thu, 22 Mar 2018 17:12:33 +0000 Subject: [PATCH] Fix nothing to do if upgrading only repo packages Dont display clean/edit menu when upgrading only repo packages. --- install.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/install.go b/install.go index a76361ae..6af06e25 100644 --- a/install.go +++ b/install.go @@ -91,7 +91,14 @@ func install(parser *arguments) error { } } - hasAur := len(dt.Aur) != 0 + hasAur := false + for pkg := range parser.targets { + _, ok := dt.Aur[pkg] + if ok { + hasAur = true + } + } + if hasAur && 0 == os.Geteuid() { return fmt.Errorf(red(arrow + " Refusing to install AUR Packages as root, Aborting.")) } @@ -108,7 +115,7 @@ func install(parser *arguments) error { arguments.addTarget(pkg) } - if len(dc.Aur) == 0 && len(arguments.targets) == 0 { + if len(dc.Aur) == 0 && len(arguments.targets) == 0 && !parser.existsArg("u", "sysupgrade") { fmt.Println("There is nothing to do") return nil }