extras-buildsys/utils ExtrasPushUtils.py, 1.9, 1.10 ExtrasMultiLib.py, 1.11, 1.12 extras-repobuild.py, 1.29, 1.30 extras-repoview.py, 1.13, 1.14 extras-repomanage.py, 1.1, 1.2 extras-push-new, 1.61, 1.62

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


Author: mschwendt

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

Modified Files:
	ExtrasPushUtils.py ExtrasMultiLib.py extras-repobuild.py 
	extras-repoview.py extras-repomanage.py extras-push-new 
Log Message:
- better comment on fix_mdcache_access()
- call it after downloading metadata
- define extras_signers umask in a single place
- set umask in more scripts



Index: ExtrasPushUtils.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/ExtrasPushUtils.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ExtrasPushUtils.py	19 Sep 2006 23:34:09 -0000	1.9
+++ ExtrasPushUtils.py	20 Sep 2006 12:33:02 -0000	1.10
@@ -21,6 +21,7 @@
 import stat, tempfile
 
 signersgid = 100581  # signers group
+signersumask = 0002
 
 distro = 'fedora'
 project = 'extras'
@@ -150,8 +151,11 @@
 
 
 def fix_mdcache_access(workdir,cachedir):
-# Work around explicit mode 0755 in yum/repos.py and an utime access
-# denied problem in urlgrabber.
+# Work around explicit directory mode 0755 in yum/repos.py (that
+# is too restrictive for our extras_signers group) and an utime
+# access denied problem in urlgrabber (file ownership is needed,
+# group ownership is insufficent).
+#
 # 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


Index: ExtrasMultiLib.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/ExtrasMultiLib.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ExtrasMultiLib.py	19 Sep 2006 23:34:09 -0000	1.11
+++ ExtrasMultiLib.py	20 Sep 2006 12:33:02 -0000	1.12
@@ -306,13 +306,16 @@
         else:
             repo.enable()
     my.repos.setCacheDir(cachedir)
-    fix_mdcache_access(rundir,cachedir)
     try:
         print 'Reading metadata...'
         my.readMetadata()
     except yum.Errors.RepoError, e:
         print 'Yum error: %s' % e
+    except:
+        fix_mdcache_access(rundir,cachedir)
+        raise
     print 'done.'
+    fix_mdcache_access(rundir,cachedir)
 
     ts = rpmUtils.transaction.initReadOnlyTransaction()
     compatrepodir = os.path.join(treedir,dist,srcarch)
@@ -343,7 +346,7 @@
 
 if __name__ == '__main__':
     signer_gid_check()
-    os.umask(0002)
+    os.umask(signersumask)
 
     if len(sys.argv) < 2:
         print 'SYNTAX: %s <dist> [dist]...' % sys.argv[0]


Index: extras-repobuild.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/extras-repobuild.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- extras-repobuild.py	19 Sep 2006 09:56:55 -0000	1.29
+++ extras-repobuild.py	20 Sep 2006 12:33:02 -0000	1.30
@@ -32,6 +32,7 @@
 if __name__ == '__main__':
     me = os.getcwd()
     signer_gid_check()
+    os.umask(signersumask)
     if len(sys.argv) < 2:
         print "Usage:\nextras-repobuild.py release\n\n"
         sys.exit(1)


Index: extras-repoview.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/extras-repoview.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- extras-repoview.py	20 Aug 2006 23:13:19 -0000	1.13
+++ extras-repoview.py	20 Sep 2006 12:33:02 -0000	1.14
@@ -57,6 +57,7 @@
 if __name__ == '__main__':
     me = os.getcwd()
     signer_gid_check()
+    os.umask(signersumask)
     if len(sys.argv) < 2:
         print "Usage:\nextras-repoview.py release\n\n"
         sys.exit(1)


Index: extras-repomanage.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/extras-repomanage.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- extras-repomanage.py	17 Sep 2006 19:44:33 -0000	1.1
+++ extras-repomanage.py	20 Sep 2006 12:33:02 -0000	1.2
@@ -58,6 +58,7 @@
 if __name__ == '__main__':
     me = os.getcwd()
     signer_gid_check()
+    os.umask(signersumask)
     if len(sys.argv) < 2:
         print "Usage:\nextras-repomanage.py release\n\n"
         sys.exit(1)


Index: extras-push-new
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/extras-push-new,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- extras-push-new	19 Sep 2006 10:09:42 -0000	1.61
+++ extras-push-new	20 Sep 2006 12:33:02 -0000	1.62
@@ -60,8 +60,6 @@
 class opts:
     repoview = True
     repoclosure = True
-    gidcheck = True
-    setumask = True
     signkeycheck = True
     mail = True
     doublesync = False
@@ -636,17 +634,14 @@
 # ====================================================================
 
 if __name__ == '__main__':
-    if opts.gidcheck:
-        signer_gid_check()
+    os.umask(signersumask)
+    signer_gid_check()
     
     if opts.signkeycheck:
         if signkeyname != os.popen('rpm --eval %_gpg_name','r').read().rstrip():
             print 'ERROR: Configure ~/.rpmmacros for proper GPG signing before running this!'
             sys.exit(errno.EPERM)
 
-    if opts.setumask:
-        os.umask(0002)
-
     if '-f' in sys.argv[1:]:
         sys.argv.remove('-f')
         opts.force = True




More information about the scm-commits mailing list