Don't ask also in interactive mode if --gpg-auto-import-keys.
authorJán Kupec <jkupec@suse.cz>
Tue, 10 Nov 2009 18:11:30 +0000 (19:11 +0100)
committerJán Kupec <jkupec@suse.cz>
Tue, 10 Nov 2009 18:11:30 +0000 (19:11 +0100)
src/callbacks/keyring.h

index fb2118d..e3524fb 100644 (file)
@@ -137,22 +137,20 @@ namespace zypp
           s << str::form(_("Repository: %s"), context.repoInfo().name().c_str())
             << std::endl;
 
-        // print info and don't ask
-        if (_gopts.no_gpg_checks)
+        // if --gpg-auto-import-keys or --no-gpg-checks print info and don't ask
+        if (_gopts.gpg_auto_import_keys)
         {
+          MIL << boost::format("Automatically importing key id '%s', '%s', fingerprint '%s'")
+              % keyid % keyname % fingerprint << std::endl;
           zypper.out().info(s.str());
-          if (_gopts.gpg_auto_import_keys)
-          {
-            MIL << boost::format("Automatically importing key id '%s', '%s', fingerprint '%s'")
-                % keyid % keyname % fingerprint << std::endl;
-            return KeyRingReport::KEY_TRUST_AND_IMPORT;
-          }
-          else
-          {
-            MIL << boost::format("Automatically trusting key id '%s', '%s', fingerprint '%s'")
-                % keyid % keyname % fingerprint << std::endl;
-            return KeyRingReport::KEY_TRUST_TEMPORARILY;
-          }
+          return KeyRingReport::KEY_TRUST_AND_IMPORT;
+        }
+        else if (_gopts.no_gpg_checks)
+        {
+          MIL << boost::format("Automatically trusting key id '%s', '%s', fingerprint '%s'")
+              % keyid % keyname % fingerprint << std::endl;
+          zypper.out().info(s.str());
+          return KeyRingReport::KEY_TRUST_TEMPORARILY;
         }
 
         // ask the user
@@ -170,10 +168,10 @@ namespace zypp
           // The anserws must be separated by slash characters '/' and must
           // correspond to reject/trusttemporarily/trustalways in that order.
           // The answers should be lower case letters.
-          popts.setOptions(_("r/t/a/"), _gopts.gpg_auto_import_keys ? 2 : 0);
+          popts.setOptions(_("r/t/a/"), 0);
         else
           // translators: the same as r/t/a, but without 'a'
-          popts.setOptions(_("r/t"), _gopts.gpg_auto_import_keys ? 1 : 0);
+          popts.setOptions(_("r/t"), 0);
         // translators: help text for the 'r' option in the 'r/t/a' prompt
         popts.setOptionHelp(0, _("Don't trust the key."));
         // translators: help text for the 't' option in the 'r/t/a' prompt