extras-buildsys/utils/pushscript Config_Extras.py, 1.22, 1.23 Push.py, 1.29, 1.30
Michael Schwendt (mschwendt)
fedora-extras-commits at redhat.com
Wed Feb 21 20:34:34 UTC 2007
Author: mschwendt
Update of /cvs/fedora/extras-buildsys/utils/pushscript
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21951
Modified Files:
Config_Extras.py Push.py
Log Message:
Add a whitelist feature. By default all package names are on the
list unless the dist is marked as frozen. Then it is only possible
to push packages with a separate script.
Index: Config_Extras.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/pushscript/Config_Extras.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- Config_Extras.py 20 Feb 2007 12:40:16 -0000 1.22
+++ Config_Extras.py 21 Feb 2007 20:34:32 -0000 1.23
@@ -42,6 +42,8 @@
alldists = [ 'development', '6', '5' ] # also the order in build reports
+frozendists = [ 'development' ]
+
archdict = {'3':['x86_64', 'i386'],
'4':['ppc','x86_64', 'i386'],
'5':['ppc','x86_64', 'i386'],
Index: Push.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/pushscript/Push.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- Push.py 9 Feb 2007 19:23:42 -0000 1.29
+++ Push.py 21 Feb 2007 20:34:32 -0000 1.30
@@ -18,6 +18,7 @@
import errno
import fcntl, fnmatch
import os, sys
+import re
import rpmUtils
import shutil
import string
@@ -385,7 +386,7 @@
rundirfile.close()
-def copy_sign_move(dist):
+def copy_sign_move(dist,whitelist=['.*']):
"""Copies, signs and moves packages for the given dist.
Returns (errcode, changed) where errcode is an error code and changed
is a boolean indicating whether the target repo was changed."""
@@ -423,6 +424,7 @@
prune_needsign_tree(needsignroot)
results = get_build_results(needsignroot,droppushed=True)
results = BlackList.get_filtered_build_results(cfg,dist,results)
+ results = apply_whitelist(results,whitelist)
print 'Package directories found: %d' % len(results)
if len(results) == 0:
return 0, changed
@@ -511,6 +513,16 @@
return 0, changed
+
+def apply_whitelist(results, whitelist):
+ newresults = []
+ for (name,pkgrelroots) in results:
+ for r in whitelist:
+ if re.compile('^'+r+'$').search(name):
+ newresults.append((name,pkgrelroots))
+ continue
+ return newresults
+
# ====================================================================
import datetime
@@ -613,7 +625,10 @@
mustfinish = [] # dists with pending build report
totalchanges = 0
for dist in diststopush:
- result, repochanged = copy_sign_move(dist)
+ whitelist = ['.*'] # all (regexp)
+ if dist in cfg.frozendists:
+ whitelist = []
+ result, repochanged = copy_sign_move(dist,whitelist)
if result:
sys.exit(result)
if repochanged:
More information about the scm-commits
mailing list