Skip to content

Commit

Permalink
Merge pull request Jguer#276 from Morganamilo/fixagain
Browse files Browse the repository at this point in the history
Fix nothing to do if upgrading only repo packages
  • Loading branch information
Morganamilo authored Mar 22, 2018
2 parents 59b74e1 + 2ea1683 commit f1fd4a1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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."))
}
Expand All @@ -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
}
Expand Down

0 comments on commit f1fd4a1

Please sign in to comment.