extras-buildsys/utils extras-repobuild.py,1.17,1.18

Ville Skytta (scop) fedora-extras-commits at redhat.com
Mon May 15 20:36:49 UTC 2006


Author: scop

Update of /cvs/fedora/extras-buildsys/utils
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19726

Modified Files:
	extras-repobuild.py 
Log Message:
"grep -v" stuff we don't want to repomanage (kmods for now) while waiting for
https://devel.linux.duke.edu/bugzilla/show_bug.cgi?id=604



Index: extras-repobuild.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/extras-repobuild.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- extras-repobuild.py	11 May 2006 16:07:40 -0000	1.17
+++ extras-repobuild.py	15 May 2006 20:36:46 -0000	1.18
@@ -35,6 +35,12 @@
             '5':['ppc','x86_64', 'i386'],
             'development':['ppc','x86_64','i386'],
             }
+# packages to exclude from being repomanaged: dist => shell quoted path regexp
+keepdict = {'3': "'/\([^/]\+-\)\?kmod-'",
+            '4': "'/\([^/]\+-\)\?kmod-'",
+            '5': "'/\([^/]\+-\)\?kmod-'",
+            'development': "'/\([^/]\+-\)\?kmod-'",
+            }
 ts = rpmUtils.transaction.initReadOnlyTransaction()
 
 
@@ -56,7 +62,7 @@
             sys.exit(result)
 
 
-def do_repo_stuff(repodir, keep=2):
+def do_repo_stuff(repodir, keep=2, nomanage=None):
     compspath = os.path.join(repodir, compsname)
     rpdata = os.path.join(repodir, 'repodata')
     debugprint('removing tree %s' % rpdata)
@@ -66,7 +72,11 @@
     
     print 'processing: %s' % repodir
     print 'Cleaning up older packages (keeping %d latest)' % (keep)
-    cmd = '/usr/bin/repomanage -c -k%d -o %s | xargs rm -f' % (keep, repodir)
+    repomanage = '/usr/bin/repomanage -c -k%d -o %s' % (keep, repodir)
+    if nomanage:
+        cmd = '%s | grep -v %s | xargs rm -f' % (repomanage, nomanage)
+    else:
+        cmd = '%s | xargs rm -f' % repomanage
     run_and_check(cmd)
         
     print 'Creating repository metadata'
@@ -102,12 +112,12 @@
 
     print "Making Repository Metadata"
 
-    do_repo_stuff(os.path.join(destdir, 'SRPMS'), keep)
+    do_repo_stuff(os.path.join(destdir, 'SRPMS'), keep, keepdict.get(dist))
 
     # arch repo creation
     for arch in archdict[dist]:
         repodir = os.path.join(destdir, arch)
-        do_repo_stuff(repodir, keep)
+        do_repo_stuff(repodir, keep, keepdict.get(dist))
 
 if __name__ == '__main__':
     me = os.getcwd()




More information about the fedora-extras-commits mailing list