Hi all:

I forget the particulars,  but it was mentioned on #fedora-devel the
other day that it would be cool to be able to disable gpg checking from
the yum command line, for local package installs.

The attached patch adds a --nogpgcheck option to do just that. It tries
really hard to switch all gpgcheck attributes to False, and should be
sufficient for local package install case.

How does this look to everyone?

-James
diff --git a/cli.py b/cli.py
index 643e225..75dffe0 100644
--- a/cli.py
+++ b/cli.py
@@ -1148,6 +1148,12 @@ class YumOptionParser(OptionParser):
             # make sure the added repos are setup.        
             if len(opts.repos) > 0:
                 self.base._getRepos(doSetup=True)
+
+            # Disable all gpg key checking, if requested.
+            if opts.nogpgcheck:
+                self.base.conf.gpgcheck = False
+                for repo in self.base.repos.listEnabled():
+                    repo.gpgcheck = False
                             
         except ValueError, e:
             self.logger.critical(_('Options Error: %s'), e)
@@ -1225,6 +1231,9 @@ class YumOptionParser(OptionParser):
         self.add_option("", "--noplugins", dest="noplugins",
                 default=False, action="store_true", 
                 help="disable Yum plugins")
+        self.add_option("", "--nogpgcheck", dest="nogpgcheck",
+                default=False, action="store_true",
+                help="disable gpg key checking")
         
         
 

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Reply via email to