extras-buildsys/utils extras-push-new,1.29,1.30
Michael Schwendt (mschwendt)
fedora-extras-commits at redhat.com
Fri Jun 9 10:21:04 UTC 2006
- Previous message (by thread): rpms/wine/devel .cvsignore, 1.16, 1.17 sources, 1.17, 1.18 wine.spec, 1.28, 1.29
- Next message (by thread): rpms/sylpheed/FC-5 .cvsignore, 1.17, 1.18 sources, 1.17, 1.18 sylpheed.spec, 1.29, 1.30 sylpheed-2.2.5-smtp_timeout.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: mschwendt
Update of /cvs/fedora/extras-buildsys/utils
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8618
Modified Files:
extras-push-new
Log Message:
- remove unneeded and pushed builds from plague-results repo after >48 hours
- make the tmp dir removal debug msg more clear
Index: extras-push-new
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/extras-push-new,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- extras-push-new 9 Jun 2006 09:15:57 -0000 1.29
+++ extras-push-new 9 Jun 2006 10:21:01 -0000 1.30
@@ -22,6 +22,7 @@
import shutil
import string
import tempfile
+import time
DEBUG = False
@@ -189,29 +190,40 @@
def mark_pkg_pushed(pkgrelroot):
fname = os.path.join(pkgrelroot,'PUSHED')
+ if os.path.isfile(fname):
+ return
if DEBUG:
print 'Creating %s' % fname
return
try:
f = open(fname,'w')
+ f.close()
except IOError, (err, strerr):
print 'ERROR: %s: %s' % (strerr,fname)
sys.exit(err) # fatal for our needs
- f.close()
def prune_needsign_tree(repodir):
- # Currently, this only marks unneeded package build job directories
- # as PUSHED.
- #
- # TODO: Make this remove sufficiently old PUSHED directories.
-
# The root dir contains a directory for every pushed package "name".
for name in list_repo_root(repodir):
pkgroot = os.path.join(repodir,name)
if not os.path.isdir(pkgroot):
continue
+
# Every version-release is stored in an own sub-dir.
+ # Delete those builds which are marked as PUSHED and old enough.
+ for pkgreldir in os.listdir(pkgroot):
+ pkgrelroot = os.path.join(pkgroot,pkgreldir)
+ flagname = os.path.join(pkgrelroot,'PUSHED')
+ if not os.path.isfile(flagname):
+ continue
+ mtime = os.path.getmtime(flagname)
+ if ( time.time()-mtime > 3600*48 ):
+ print 'Removing old %s' % pkgreloot
+ if not DEBUG:
+ shutil.rmtree(pkgrelroot)
+
+ # Now re-examine the remaining builds and mark unneeded ones as PUSHED.
pkgreldirs = os.listdir(pkgroot)
debugprint( '%s release(s) for %s: %s' % (len(pkgreldirs),name,' '.join(pkgreldirs)) )
if len(pkgreldirs) < 2: # only one release or empty dir
@@ -429,7 +441,7 @@
debugcopy2(src,dst)
except:
print 'ERROR: Creating temporary working copy failed.'
- debugprint('Removing tree %s' % signtmpdir)
+ debugprint('Removing tmp tree %s' % signtmpdir)
if not DEBUG:
shutil.rmtree(signtmpdir)
sys.exit(errno.EIO)
@@ -445,7 +457,7 @@
result = sign_pkgs(relocrpms)
if result:
print "Error signing packages"
- debugprint('Removing tree %s' % signtmpdir)
+ debugprint('Removing tmp tree %s' % signtmpdir)
if not DEBUG:
shutil.rmtree(signtmpdir)
return result
@@ -522,7 +534,7 @@
for path in files['pkgrelroot']:
mark_pkg_pushed(path)
- debugprint('Removing tree %s' % signtmpdir)
+ debugprint('Removing tmp tree %s' % signtmpdir)
if not DEBUG:
shutil.rmtree(signtmpdir)
return(0)
- Previous message (by thread): rpms/wine/devel .cvsignore, 1.16, 1.17 sources, 1.17, 1.18 wine.spec, 1.28, 1.29
- Next message (by thread): rpms/sylpheed/FC-5 .cvsignore, 1.17, 1.18 sources, 1.17, 1.18 sylpheed.spec, 1.29, 1.30 sylpheed-2.2.5-smtp_timeout.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list