[Yum-devel] [PATCH] Add sane archlist default to repodiff

James Antill james at and.org
Tue Apr 13 21:00:36 UTC 2010


---
 docs/repodiff.1 |    5 ++++-
 repodiff.py     |    8 +++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/docs/repodiff.1 b/docs/repodiff.1
index e1ffc3b..a7f552f 100644
--- a/docs/repodiff.1
+++ b/docs/repodiff.1
@@ -15,7 +15,10 @@ Add a repo. as an old repo.
 .IP "\fB\-\-new, -n\fP"
 Add a repo. as an new repo.
 .IP "\fB\-\-archlist, -a\fP"
-Add architectures to change the default from just comparing source packages.
+Change the architectures used to compare packages. The default is to always
+compare source rpms, and if no argument is passed the native supported
+architectures are added as well. Note that if you want the same as a native
+"x86_64" architecture machine you need: x86_64,athlon,i686,i586,i486,i386,noarch
 .IP "\fB\-\-size, -s\fP"
 Ouput additional data about the size of the changes.
 .SH "EXAMPLES"
diff --git a/repodiff.py b/repodiff.py
index 5f3d5b1..bed145c 100755
--- a/repodiff.py
+++ b/repodiff.py
@@ -104,7 +104,7 @@ class DiffYum(yum.YumBase):
         return ygh
 
 
-def parseArgs(args):
+def parseArgs(self, args):
     """
        Parse the command line args. return a list of 'new' and 'old' repos
     """
@@ -122,7 +122,7 @@ def parseArgs(args):
                       help="old baseurl[s] for repos")
     parser.add_option("-q", "--quiet", default=False, action='store_true')
     parser.add_option("-a", "--archlist", default=[], action="append",
-                      help="In addition to src.rpms, any arch you want to include")
+                      help="Change the archlist, from the yum default (.src.rpms are always compared)")
     parser.add_option("-s", "--size", default=False, action='store_true',
                       help="Output size changes for any new->old packages")
     (opts, argsleft) = parser.parse_args()
@@ -136,16 +136,18 @@ def parseArgs(args):
     for a in opts.archlist:
         for arch in a.split(','):
             archlist.append(arch)
+    if not opts.archlist:
+        archlist.extend(self.arch.archlist)
 
     opts.archlist = archlist             
     
     return opts
 
 def main(args):
-    opts = parseArgs(args)
 
             
     my = DiffYum()
+    opts = parseArgs(my, args)
     if opts.quiet:
         my.conf.debuglevel=0
         my.doLoggingSetup(my.conf.debuglevel, my.conf.errorlevel)
-- 
1.6.6.1



More information about the Yum-devel mailing list