Ver código fonte

Su is now handled. References #39

Jguer 7 anos atrás
pai
commit
f80e3130ab
3 arquivos alterados com 9 adições e 7 exclusões
  1. 1 1
      aur/aur.go
  2. 1 5
      upgrade/u.go
  3. 7 1
      yay.go

+ 1 - 1
aur/aur.go

@@ -18,7 +18,7 @@ import (
 // BaseURL givers the AUR default address.
 const BaseURL string = "https://aur.archlinux.org"
 
-var specialDBsauce bool = false
+var specialDBsauce = false
 
 // NarrowSearch searches AUR and narrows based on subarguments
 func NarrowSearch(pkgS []string, sortS bool) (Query, error) {

+ 1 - 5
upgrade/u.go

@@ -110,7 +110,7 @@ func Print(start int, u Slice) {
 			for i := 0; i < len(name); i++ {
 				hash = int(name[i]) + ((hash << 5) + (hash))
 			}
-			return (hash)%6 + 31
+			return hash%6 + 31
 		}
 		fmt.Printf("\x1b[33m%-2d\x1b[0m ", len(u)+start-k-1)
 		fmt.Printf("\x1b[1;%dm%s\x1b[0m/\x1b[1;39m%-25s\t\t\x1b[0m", f(i.Repository), i.Repository, i.Name)
@@ -130,10 +130,6 @@ func Print(start int, u Slice) {
 
 // List returns lists of packages to upgrade from each source.
 func List() (aurUp Slice, repoUp Slice, err error) {
-	err = config.PassToPacman("-Sy", nil, nil)
-	if err != nil {
-		return
-	}
 
 	local, remote, _, remoteNames, err := FilterPackages()
 	if err != nil {

+ 7 - 1
yay.go

@@ -142,7 +142,13 @@ func main() {
 		}
 	case "-S":
 		err = install(pkgs, options)
-	case "-Syu", "-Suy":
+	case "-Syu", "-Suy", "-Su":
+		if strings.Contains(op, "y") {
+			err = config.PassToPacman("-Sy", nil, nil)
+			if err != nil {
+				break
+			}
+		}
 		err = upgradePkgs(options)
 	case "-Si":
 		err = syncInfo(pkgs, options)