extras-buildsys/utils/pushscript MultiLib.py,1.16,1.17

Michael Schwendt mschwendt at fedoraproject.org
Thu Nov 6 12:25:23 UTC 2008


Author: mschwendt

Update of /cvs/fedora/extras-buildsys/utils/pushscript
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv31837

Modified Files:
	MultiLib.py 
Log Message:
- update for 'development' dist repo layout
- drop incomplete DEBUG flag usage



Index: MultiLib.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/pushscript/MultiLib.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- MultiLib.py	21 Jul 2008 20:39:08 -0000	1.16
+++ MultiLib.py	6 Nov 2008 12:25:23 -0000	1.17
@@ -28,9 +28,6 @@
 except: # yum < 2.9
     from repomd.packageSack import ListPackageSack
 
-DEBUG = False
-Utils.setdebug(DEBUG)
-
 # The following dict can be generated with rpmUtils.arch functions.
 # target arch -> compatible archs
 compatarchdict = { 'x86_64' : ['x86_64', 'athlon', 'i686', 'i586', 'i486', 'i386', 'noarch'],
@@ -103,9 +100,9 @@
         if not isWantedName(cfg,dist,targetarch,names):
             continue
         
-        srpmloc = os.path.join(cfg.treedir,dist,'SRPMS',srcrpm)
-        if DEBUG and not os.path.isfile(srpmloc):
-            srpmloc = srpmlocdict[srcrpm]
+        srpmloc = os.path.join( Utils.srpm_repodir(cfg,dist), srcrpm )
+        #if DEBUG and not os.path.isfile(srpmloc):
+        #    srpmloc = srpmlocdict[srcrpm]
 
         try:
             hdr = rpmUtils.miscutils.hdrFromPackage(ts,srpmloc)
@@ -149,7 +146,7 @@
     global missingdict
     missingdict = {}
     for srcarch in cfg.archdict[dist]:  # list of repo archs
-        srcdir = os.path.join(cfg.treedir,dist,srcarch)
+        srcdir = Utils.rpm_repodir(cfg,dist,srcarch)
         print 'Scanning for multi-compat packages:', srcdir
         files = glob.glob('%s/*.rpm' % srcdir)
         for f in files:
@@ -290,11 +287,17 @@
     print 'done.'
     Utils.fix_mdcache_access(cfg.rundir,cfg.cachedir)
 
+    srcrepodir = Utils.rpm_repodir(cfg, testdist, srcarch)
+    srcdebugrepodir = Utils.debug_repodir(cfg, testdist, srcarch)
+    destrepodir = Utils.rpm_repodir(cfg, testdist, targetarch)
+    destdebugrepodir = Utils.debug_repodir(cfg, testdist, targetarch)
+    extdestrepodir = Utils.rpm_repodir(cfg, dist, targetarch)
+    extdestdebugrepodir = Utils.debug_repodir(cfg, dist, targetarch)
+
     ts = rpmUtils.transaction.initReadOnlyTransaction()
-    compatrepodir = os.path.join(cfg.treedir,testdist,srcarch)
     for f in missingdict[targetarch]['rpms']:
         print f
-        fpath = os.path.join(compatrepodir,f)
+        fpath = os.path.join(srcrepodir,f)
         pkg = YumLocalPackage(ts=ts,filename=fpath)
         my.resolveRequires(pkg)
 
@@ -310,39 +313,34 @@
                 print 'WARNING: missing', srcfile
             return False
         if not os.path.exists(destfile):  # silent extra-check
-            print 'Adding:', destfile
+            print '  Adding:', destfile
             Utils.install_link_or_copy(srcfile,destfile)
             return True
         else:
             return False
 
-    destreporoot = os.path.join(cfg.treedir,testdist,targetarch)
-    srcreporoot = os.path.join(cfg.treedir,testdist,srcarch)
     for f in missingdict[targetarch]['rpms']:
-        if addrpm(f,srcreporoot,destreporoot):
+        if addrpm(f,srcrepodir,destrepodir):
             changed = True
     
     for repoid in my.needed.keys():
         if repoid.find('testing')<0:
             # Make available new multi-lib deps from non-testing repo.
-            srcreporoot = os.path.join(cfg.treedir,dist,srcarch)
+            srcrepodir = Utils.rpm_repodir(cfg,dist,srcarch)
             addfromext = True
         else:
-            srcreporoot = os.path.join(cfg.treedir,testdist,srcarch)
             addfromext = False
         for f in my.needed[repoid]['rpms']:
             if addfromext:
-                if os.path.exists(os.path.join(cfg.treedir,dist,targetarch,f)):
+                if os.path.exists(os.path.join(extdestrepodir,f)):
                     continue
-            if addrpm(f,srcreporoot,destreporoot):
+            if addrpm(f,srcrepodir,destrepodir):
                 changed = True
-        destdebugreporoot = os.path.join(destreporoot,'debug')
-        srcdebugreporoot = os.path.join(srcreporoot,'debug')
         for f in my.needed[repoid]['debug']:
             if addfromext:
-                if os.path.exists(os.path.join(cfg.treedir,dist,targetarch,'debug',f)):
+                if os.path.exists(os.path.join(extdestdebugrepodir,f)):
                     continue
-            if addrpm(f,srcdebugreporoot,destdebugreporoot):
+            if addrpm(f,srcdebugrepodir,destdebugrepodir):
                 changed = True
 
     print 'done.'
@@ -357,7 +355,8 @@
         for arch in cfg.archdict[dist]:  # list of repo archs
             changedagain = resolveMissing(cfg,dist,arch)
             if changedagain:
-                Utils.create_repository(cfg,dist,os.path.join(cfg.treedir,dist,arch))
+                Utils.create_repository(cfg, dist, Utils.rpm_repodir(cfg,dist,arch) )
+                Utils.create_repository(cfg, dist, Utils.debug_repodir(cfg,dist,arch), debuginfo=True )
 
 
 if __name__ == '__main__':




More information about the fedora-extras-commits mailing list