[yum-git] debuginfo-install.py yum-builddep.py yum-complete-transaction.py yumdownloader.py

Seth Vidal skvidal at linux.duke.edu
Mon Apr 28 04:17:24 UTC 2008


 debuginfo-install.py        |    4 ++--
 yum-builddep.py             |    4 ++--
 yum-complete-transaction.py |    6 +-----
 yumdownloader.py            |   18 +++++++++---------
 4 files changed, 14 insertions(+), 18 deletions(-)

New commits:
commit 6b823cd07e4ca79c2d2b4b9c4bb297cc9aad6f72
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Sun Apr 27 23:35:15 2008 -0400

    make sure all yum-utils using self.getOptionParser set it up as self.optparser not as 'parser' or anything else.
    
    this change is necessary due yum git checkin: 761e58a85937e9c56c7387c4d535e77db1b27c7b

diff --git a/debuginfo-install.py b/debuginfo-install.py
index 436e40f..7b88bdc 100755
--- a/debuginfo-install.py
+++ b/debuginfo-install.py
@@ -43,12 +43,12 @@ class DebugInfoInstall(YumUtilBase):
 
     def main(self):
         # Add util commandline options to the yum-cli ones
-        parser = self.getOptionParser() 
+        self.optparser = self.getOptionParser() 
         # Parse the commandline option and setup the basics.
         opts = self.doUtilConfigSetup()
         # Check if there is anything to do.
         if len(self.cmds) < 1: 
-            parser.print_help()
+            self.optparser.print_help()
             sys.exit(0)
         if os.geteuid() != 0:
             print >> sys.stderr, "You must be root to run this command."
diff --git a/yum-builddep.py b/yum-builddep.py
index 5a69fe7..b8d2622 100755
--- a/yum-builddep.py
+++ b/yum-builddep.py
@@ -42,7 +42,7 @@ class YumBuildDep(YumUtilBase):
 
     def main(self):
         # Add util commandline options to the yum-cli ones
-        parser = self.getOptionParser() 
+        self.optparser = self.getOptionParser() 
         # Parse the commandline option and setup the basics.
         try:
             opts = self.doUtilConfigSetup()
@@ -52,7 +52,7 @@ class YumBuildDep(YumUtilBase):
 
         # Check if there is anything to do.
         if len(self.cmds) < 1: 
-            parser.print_help()
+            self.optparser.print_help()
             sys.exit(0)
 
         if self.conf.uid != 0:
diff --git a/yum-complete-transaction.py b/yum-complete-transaction.py
index c181226..1563573 100755
--- a/yum-complete-transaction.py
+++ b/yum-complete-transaction.py
@@ -124,7 +124,7 @@ class YumCompleteTransaction(YumUtilBase):
 
     def main(self):
         # Add util commandline options to the yum-cli ones
-        parser = self.getOptionParser() 
+        self.optparser = self.getOptionParser() 
         # Parse the commandline option and setup the basics.
         try:
             opts = self.doUtilConfigSetup()
@@ -132,10 +132,6 @@ class YumCompleteTransaction(YumUtilBase):
             self.logger.error("Cannot handle specific enablerepo/disablerepo options.")
             sys.exit(50)
 
-        # Check if there is anything to do.
-#        if len(self.cmds) < 1: 
-#            parser.print_help()
-#            sys.exit(0)
 
         if self.conf.uid != 0:
             self.logger.error("Error: You must be root to finish transactions")
diff --git a/yumdownloader.py b/yumdownloader.py
index 8141b48..5ef8325 100755
--- a/yumdownloader.py
+++ b/yumdownloader.py
@@ -43,9 +43,9 @@ class YumDownloader(YumUtilBase):
 
     def main(self):
         # Add util commandline options to the yum-cli ones
-        parser = self.getOptionParser() 
+        self.optparser = self.getOptionParser() 
         # Add command line option specific to yumdownloader
-        self.addCmdOptions(parser)
+        self.addCmdOptions()
         # Parse the commandline option and setup the basics.
         try:
             opts = self.doUtilConfigSetup()
@@ -55,7 +55,7 @@ class YumDownloader(YumUtilBase):
                 
         # Check if there is anything to do.
         if len(self.cmds) < 1: 
-            parser.print_help()
+            self.optparser.print_help()
             sys.exit(0)
 
         # make yumdownloader work as non root user.
@@ -262,16 +262,16 @@ class YumDownloader(YumUtilBase):
                 self.repos.disableRepo(repo.id)
                 srcrepo = repo.id
 
-    def addCmdOptions(self,parser):
-        parser.add_option("--destdir", default=".", dest="destdir",
+    def addCmdOptions(self):
+        self.optparser.add_option("--destdir", default=".", dest="destdir",
           help='destination directory (defaults to current directory)')
-        parser.add_option("--urls", default=False, dest="urls", action="store_true",
+        self.optparser.add_option("--urls", default=False, dest="urls", action="store_true",
           help='just list the urls it would download instead of downloading')
-        parser.add_option("--resolve", default=False, dest="resolve", action="store_true",
+        self.optparser.add_option("--resolve", default=False, dest="resolve", action="store_true",
           help='resolve dependencies and download required packages')
-        parser.add_option("--source", default=False, dest="source", action="store_true",
+        self.optparser.add_option("--source", default=False, dest="source", action="store_true",
           help='operate on source packages')
-        parser.add_option("--archlist",
+        self.optparser.add_option("--archlist",
           help="only download packages of certain architecture(s)")        
 if __name__ == '__main__':
     util = YumDownloader()



More information about the Yum-cvs-commits mailing list