extras-repoclosure rc-run.py,1.15,1.16

Michael Schwendt (mschwendt) fedora-extras-commits at redhat.com
Wed Sep 20 12:38:06 UTC 2006


Author: mschwendt

Update of /cvs/fedora/extras-repoclosure
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29839

Modified Files:
	rc-run.py 
Log Message:
- re-use fix_mdcache_access() here
- re-use signers umask here



Index: rc-run.py
===================================================================
RCS file: /cvs/fedora/extras-repoclosure/rc-run.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- rc-run.py	29 Jul 2006 22:10:23 -0000	1.15
+++ rc-run.py	20 Sep 2006 12:38:04 -0000	1.16
@@ -8,8 +8,6 @@
 import datetime, time
 import tempfile
 
-signersgid = 100581  # signers group
-
 workdir = '/srv/rpmbuild/extras-repoclosure'
 cachedir = '/srv/rpmbuild/extras-repoclosure/mdcache'
 
@@ -17,6 +15,9 @@
 sys.path.append('/srv/extras-push/work/extras-repoclosure')
 from RepoSupport import RepoSupport
 
+sys.path.append('/srv/extras-push/work/buildsys-utils')
+from ExtrasPushUtils import *
+
 
 def makereport():
     try:
@@ -32,56 +33,17 @@
         # -n, --newest : yum-utils 0.5
         # -d : modified version only
         rc = os.system('rc-modified -q -d %s -n -c %s %s >> %s' % (cachedir,conffile,rcargs,logfilename))
+        fix_mdcache_access(workdir,cachedir)
         if rc:
             return False
     return True
 
 # Main.
 
-if os.getgid() != signersgid:
-    grpname = '(unknown)'
-    try:
-        import grp
-        grpname = grp.getgrgid(signersgid)[0]
-    except:
-        print 'WARNING: Could not get group name for gid %d' % signersgid
-    print 'ERROR: Change into the %s group before running this!  Use "newgrp %s".' % (grpname, grpname)
-    sys.exit(errno.EPERM)
-
+signer_gid_check()
 cwd = os.getcwd()
 os.chdir(workdir)
-os.umask(0002)  # only for our /srv environment
-
-# Work around explicit mode 0755 in yum/repos.py and an utime access
-# denied problem in urlgrabber.
-# We copy the mdcache tree to a temporary directory in order to
-# become the owner of all files, then remove the copied tree and fix
-# up directory modes. For this to work flawlessly, all files must be
-# readable by our group.
-try:
-    tmpdir = tempfile.mkdtemp('','.mdcache.tmp',workdir)
-    if tmpdir == workdir: # paranoid, should never happen
-        raise Exception
-except:
-    sys.exit(errno.EIO)
-if os.path.isdir(cachedir):
-    tmpcachedir = os.path.join(tmpdir,'mdcache')
-    try:
-        shutil.copytree(src=cachedir,dst=tmpcachedir,symlinks=True)
-    except:
-        print 'FATAL ERROR: mdcache copytree failed'
-        print '%s must be writable\n%s must be readable' % (workdir, cachedir)
-        shutil.rmtree(tmpdir)
-        sys.exit(1)
-    for root, dirs, files in os.walk(tmpcachedir):
-        for file in files:
-            fullpath = os.path.join(root,file)
-            filemode = stat.S_IMODE( os.stat(fullpath).st_mode )
-            filemode |= stat.S_IWGRP
-            os.chmod(fullpath,filemode)
-    shutil.rmtree(cachedir)
-    shutil.move(src=tmpcachedir,dst=cachedir)
-    shutil.rmtree(tmpdir)
+os.umask(signersumask)  # only for our /srv environment
 
 # Delete old log files.
 import glob




More information about the scm-commits mailing list