[yum-git] reposync.py repotrack.py

Seth Vidal skvidal at linux.duke.edu
Thu Mar 13 14:54:53 UTC 2008


 reposync.py  |    7 +++++--
 repotrack.py |   18 +++++++++++++-----
 2 files changed, 18 insertions(+), 7 deletions(-)

New commits:
commit cb6effa69d7e6e8528ae4263efbf415e1e1a0ca8
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Thu Mar 13 10:51:43 2008 -0400

    fix rh bug: 427724 - add --arch to repotrack
    fix minor bug with --urls in reposync

diff --git a/reposync.py b/reposync.py
index 1eaa2ce..62244d3 100755
--- a/reposync.py
+++ b/reposync.py
@@ -222,10 +222,13 @@ def main():
                 continue
     
             if opts.urls:
+                baseurl = None
                 if repo.urls[0][-1] != '/':
                     baseurl = repo.urls[0] + '/'
-                url = urljoin(baseurl,remote)
-                print '%s' % url
+                else:
+                    baseurl = repo.urls[0]
+                    url = urljoin(baseurl,remote)
+                    print '%s' % url
                 continue
     
             # make sure the repo subdir is here before we go on.
diff --git a/repotrack.py b/repotrack.py
index b89386d..e99bc74 100755
--- a/repotrack.py
+++ b/repotrack.py
@@ -31,6 +31,8 @@ import logging
 
 import yum
 import yum.Errors
+import rpmUtils
+
 from yum.misc import getCacheDir
 from yum.constants import *
 from yum.packages import parsePackages
@@ -91,8 +93,8 @@ def parseArgs():
     parser = OptionParser(usage=usage)
     parser.add_option("-c", "--config", default='/etc/yum.conf',
         help='config file to use (defaults to /etc/yum.conf)')
-#    parser.add_option("-a", "--arch", default=None,
-#        help='check as if running the specified arch (default: current arch)')
+    parser.add_option("-a", "--arch", default=None,
+        help='check as if running the specified arch (default: current arch)')
     parser.add_option("-r", "--repoid", default=[], action='append',
         help="specify repo ids to query, can be specified multiple times (default is all enabled)")
     parser.add_option("-t", "--tempcache", default=False, action="store_true", 
@@ -105,7 +107,7 @@ def parseArgs():
         help="Toggle downloading only the newest packages(defaults to newest-only)")
     parser.add_option("-q", "--quiet", default=False, action="store_true", 
         help="Output as little as possible")
-        
+                          
     (opts, args) = parser.parse_args()
     return (opts, args)
 
@@ -113,7 +115,6 @@ def parseArgs():
 def main():
 # TODO/FIXME
 # gpg/sha checksum them
-# make -a do something
 
     (opts, user_pkg_list) = parseArgs()
     
@@ -135,6 +136,12 @@ def main():
     my = RepoTrack(opts=opts)
     my.doConfigSetup(fn=opts.config,init_plugins=False) # init yum, without plugins
     
+    if opts.arch:
+        archlist = []
+        archlist.extend(rpmUtils.arch.getArchList(opts.arch))
+    else:
+        archlist = rpmUtils.arch.getArchList()
+        
     # do the happy tmpdir thing if we're not root
     if os.geteuid() != 0 or opts.tempcache:
         cachedir = getCacheDir()
@@ -158,9 +165,10 @@ def main():
         # enable the ones we like
         for repo in myrepos:
             repo.enable()
+            self._getSacks(archlist=archlist, thisrepo=repo.id)
 
     my.doRepoSetup()    
-    my.doSackSetup()
+    my._getSacks(archlist=archlist)
     
     unprocessed_pkgs = {}
     final_pkgs = {}



More information about the Yum-cvs-commits mailing list