|
@@ -41,14 +41,12 @@ func (set pgpKeySet) get(key string) bool {
|
|
|
}
|
|
|
|
|
|
// checkPgpKeys iterates through the keys listed in the PKGBUILDs and if needed,
|
|
|
-// asks the user whether yay should try to import them. gpgExtraArgs are extra
|
|
|
-// parameters to pass to gpg, in order to facilitate testing, such as using a
|
|
|
-// different keyring. It can be nil.
|
|
|
-func checkPgpKeys(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg, gpgExtraArgs []string) error {
|
|
|
+// asks the user whether yay should try to import them.
|
|
|
+func checkPgpKeys(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg) error {
|
|
|
// Let's check the keys individually, and then we can offer to import
|
|
|
// the problematic ones.
|
|
|
problematic := make(pgpKeySet)
|
|
|
- args := append(gpgExtraArgs, "--list-keys")
|
|
|
+ args := append(strings.Fields(config.GpgFlags), "--list-keys")
|
|
|
|
|
|
// Mapping all the keys.
|
|
|
for _, pkg := range pkgs {
|
|
@@ -84,16 +82,15 @@ func checkPgpKeys(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg, gpgExtraArgs []s
|
|
|
return err
|
|
|
}
|
|
|
if continueTask(question, "nN") {
|
|
|
- return importKeys(gpgExtraArgs, problematic.toSlice())
|
|
|
+ return importKeys(problematic.toSlice())
|
|
|
}
|
|
|
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-// importKeys tries to import the list of keys specified in its argument. As
|
|
|
-// in checkGpgKeys, gpgExtraArgs are extra parameters to pass to gpg.
|
|
|
-func importKeys(gpgExtraArgs, keys []string) error {
|
|
|
- args := append(gpgExtraArgs, "--recv-keys")
|
|
|
+// importKeys tries to import the list of keys specified in its argument.
|
|
|
+func importKeys(keys []string) error {
|
|
|
+ args := append(strings.Fields(config.GpgFlags), "--recv-keys")
|
|
|
cmd := exec.Command(config.GpgBin, append(args, keys...)...)
|
|
|
cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr
|
|
|
|