瀏覽代碼

Ensure global pacman arguments are always used

morganamilo 6 年之前
父節點
當前提交
5ac36ad97e
共有 4 個文件被更改,包括 15 次插入6 次删除
  1. 1 1
      clean.go
  2. 1 1
      cmd.go
  3. 4 4
      install.go
  4. 9 0
      parser.go

+ 1 - 1
clean.go

@@ -45,7 +45,7 @@ func cleanRemove(pkgNames []string) (err error) {
 		return nil
 	}
 
-	arguments := makeArguments()
+	arguments := cmdArgs.copyGlobal()
 	arguments.addArg("R")
 	arguments.addTarget(pkgNames...)
 

+ 1 - 1
cmd.go

@@ -350,7 +350,7 @@ func displayNumberMenu(pkgS []string) (err error) {
 	}
 
 	include, exclude, _, otherExclude := parseNumberMenu(string(numberBuf))
-	arguments := makeArguments()
+	arguments := cmdArgs.copyGlobal()
 
 	isInclude := len(exclude) == 0 && len(otherExclude) == 0
 

+ 4 - 4
install.go

@@ -282,9 +282,9 @@ func install(parser *arguments) (err error) {
 			return fmt.Errorf("Error installing repo packages")
 		}
 
-		depArguments := makeArguments()
+		depArguments := parser.copyGlobal()
 		depArguments.addArg("D", "asdeps")
-		expArguments := makeArguments()
+		expArguments := parser.copyGlobal()
 		expArguments.addArg("D", "asexplicit")
 
 		for _, pkg := range do.Repo {
@@ -1003,9 +1003,9 @@ func buildInstallPkgbuilds(dp *depPool, do *depOrder, srcinfos map[string]*gosrc
 			}
 		}
 
-		depArguments := makeArguments()
+		depArguments := parser.copyGlobal()
 		depArguments.addArg("D", "asdeps")
-		expArguments := makeArguments()
+		expArguments := parser.copyGlobal()
 		expArguments.addArg("D", "asexplicit")
 
 		//remotenames: names of all non repo packages on the system

+ 9 - 0
parser.go

@@ -88,6 +88,15 @@ func makeArguments() *arguments {
 	}
 }
 
+func (parser *arguments) copyGlobal() (cp *arguments) {
+	cp = makeArguments()
+	for k, v := range parser.globals {
+		cp.globals[k] = v
+	}
+
+	return
+}
+
 func (parser *arguments) copy() (cp *arguments) {
 	cp = makeArguments()