Ensure global pacman arguments are always used

This commit is contained in:
morganamilo 2018-10-15 13:05:38 +01:00
parent e0a5e24a12
commit 5ac36ad97e
No known key found for this signature in database
GPG Key ID: 6FE9E7996B0B082E
4 changed files with 15 additions and 6 deletions

View File

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

2
cmd.go
View File

@ -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

View File

@ -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

View File

@ -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()