extras-buildsys/utils/pushscript Utils.py, 1.5, 1.6 RepoView.py, 1.1, 1.2

Michael Schwendt (mschwendt) fedora-extras-commits at redhat.com
Sat Oct 28 00:54:52 UTC 2006


Author: mschwendt

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

Modified Files:
	Utils.py RepoView.py 
Log Message:
Also backup "debug/repodata", as we run repoview for debuginfo
packages, too (do we really want that?).

Now even less html files should be rewritten.

Temporarily run repoview non-quiet.



Index: Utils.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/pushscript/Utils.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Utils.py	27 Oct 2006 21:00:21 -0000	1.5
+++ Utils.py	28 Oct 2006 00:54:49 -0000	1.6
@@ -131,19 +131,6 @@
     if run(cmd):
         raise Exception
     
-    if debuginfo:
-        # If there's a debug subdir, make that a repo, too.
-        dbg_repodir = os.path.join(repodir, 'debug')
-        if os.path.exists(dbg_repodir):
-            print 'Creating repository %s' % dbg_repodir
-            rpdata = os.path.join(dbg_repodir, 'repodata')  # see above
-            debugprint('removing tree %s' % rpdata)
-            if os.path.exists(rpdata) and not DEBUG:
-                shutil.rmtree(rpdata)
-            cmd = '%s -c %s -q %s' % (cfg.createrepo, cfg.cr_cachedir, dbg_repodir)
-            if run(cmd):
-                raise Exception
-
 
 def _restore_repodata_dir(tmpdir,targetdir):  # helper function
     for f in os.listdir(tmpdir):
@@ -158,10 +145,8 @@
             shutil.move(sourcefile,targetfile)
 
 
-def create_repository(cfg,repodir,debuginfo=True):
-    """create/update repository metadata for a given directory and
-    consider a 'debug' sub-repository by default"""
-
+def _backup_create_repository(cfg,repodir,debuginfo):
+    # Create dirs, if missing, so we would create empty backups, too.
     rpdata = os.path.join(repodir,'repodata')
     for d in [repodir,rpdata]:
         if not os.path.exists(d):
@@ -193,6 +178,18 @@
         sys.exit(errno.EPERM)
     
 
+def create_repository(cfg,repodir,debuginfo=True):
+    """create/update repository metadata for a given directory and
+    consider a 'debug' sub-repository by default"""
+
+    _backup_create_repository(cfg,repodir,debuginfo)
+
+    dbg_repodir = os.path.join(repodir, 'debug')
+    # If there's a debug subdir, make that a repo, too.
+    if debuginfo and os.path.exists(dbg_repodir):
+        _backup_create_repository(cfg,dbg_repodir,False)
+
+
 def is_repo_changed(repodir):
     """Checks if the repository has changed and needs to be reindexed"""
     ref_file = os.path.join(repodir, 'repodata', 'repomd.xml')


Index: RepoView.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/pushscript/RepoView.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RepoView.py	29 Sep 2006 16:14:14 -0000	1.1
+++ RepoView.py	28 Oct 2006 00:54:49 -0000	1.2
@@ -20,14 +20,14 @@
 
 def do_repoview(cfg,repodir):
     print 'Generating repoview in %s' % repodir
-    cmd = '%s -q %s' % (cfg.repoview,repodir)
-    Utils.run_and_check(cmd)            
+    cmd = '%s %s' % (cfg.repoview,repodir)
+    Utils.run_and_check(cmd)
 
     # if there's a debug subdir, make that a repo, too.
     dbg_repodir = os.path.join(repodir, 'debug')
     if os.path.exists(dbg_repodir):
         print 'Generating repoview in %s' % dbg_repodir
-        cmd = '%s -q %s' % (cfg.repoview,dbg_repodir)
+        cmd = '%s %s' % (cfg.repoview,dbg_repodir)
         Utils.run_and_check(cmd)
 
 




More information about the scm-commits mailing list