pld-ftp-admin: scripts/from-incoming.py, scripts/gen-indexes.py - separate ...

glen glen at pld-linux.org
Wed May 27 00:46:06 CEST 2009


Author: glen                         Date: Tue May 26 22:46:06 2009 GMT
Module: pld-ftp-admin                 Tag: HEAD
---- Log message:
- separate debuginfo support

---- Files affected:
pld-ftp-admin/scripts:
   from-incoming.py (1.17 -> 1.18) , gen-indexes.py (1.25 -> 1.26) 

---- Diffs:

================================================================
Index: pld-ftp-admin/scripts/from-incoming.py
diff -u pld-ftp-admin/scripts/from-incoming.py:1.17 pld-ftp-admin/scripts/from-incoming.py:1.18
--- pld-ftp-admin/scripts/from-incoming.py:1.17	Wed May 27 00:45:32 2009
+++ pld-ftp-admin/scripts/from-incoming.py	Wed May 27 00:46:01 2009
@@ -21,6 +21,16 @@
 def mv(src, dst):
     os.rename(src, dst + '/' + src.split('/')[-1])
 
+# duplicate code in ftptree.py
+def is_debuginfo(nvr):
+    """
+    returns true if NVR is debuginfo package and separate debuginfo is enabled
+    """
+    if not config.separate_debuginfo:
+        return False
+    pkg = nvr.split('-')[:-2]
+    return pkg[-1] == 'debuginfo'
+
 def findfiles(dir):
     def filterinfos(x):
         if x[-11:] == '.uploadinfo':
@@ -183,7 +193,10 @@
                 f.write("file:%s:%s\n" % (arch, rpm))
                 srcfile = incoming_dir + arch + '/' + rpm
 
-                dstfile = default_to + arch + '/RPMS'
+                if is_debuginfo(rpm):
+                    dstfile = default_to + arch + '/debuginfo'
+                else:
+                    dstfile = default_to + arch + '/RPMS'
 
                 try:
                     mv(srcfile, dstfile)

================================================================
Index: pld-ftp-admin/scripts/gen-indexes.py
diff -u pld-ftp-admin/scripts/gen-indexes.py:1.25 pld-ftp-admin/scripts/gen-indexes.py:1.26
--- pld-ftp-admin/scripts/gen-indexes.py:1.25	Wed May 27 00:45:32 2009
+++ pld-ftp-admin/scripts/gen-indexes.py	Wed May 27 00:46:01 2009
@@ -71,8 +71,12 @@
             print 'generate poldek index for %s' % arch
             if config.poldek_indexes != "old":
                 os.system('%s -s %s%s/%s/RPMS/ --mkidxz --mkidx-type pndir' % (poldek, ftp_dir, tree, arch))
+                if config.separate_debuginfo:
+                    os.system('%s -s %s%s/%s/debuginfo/ --mkidxz --mkidx-type pndir' % (poldek, ftp_dir, tree, arch))
             if config.poldek_indexes != "new":
                 os.system('%s -s %s%s/%s/RPMS/ --mkidxz --mkidx-type pdir' % (poldek, ftp_dir, tree, arch))
+                if config.separate_debuginfo:
+                    os.system('%s -s %s%s/%s/debuginfo/ --mkidxz --mkidx-type pdir' % (poldek, ftp_dir, tree, arch))
 
 if do_yum:
     os.system('set -x; cd %s.stat/repodata && cvs up comps.xml' % ftp_dir)
@@ -84,6 +88,8 @@
             print 'generate repodata for %s using createrepo' % arch
             # Creating indexes for yum and other supporting xml repodata.
             os.system('time %s --cache %s-%s %s%s/%s/RPMS' % (yum, cachedir, arch, ftp_dir, tree, arch))
+            if config.separate_debuginfo:
+                os.system('time %s --cache %s-%s %s%s/%s/debuginfo' % (yum, cachedir, arch, ftp_dir, tree, arch))
 
 if do_rpmrepo:
     os.system('set -x; cd %s.stat/repodata && cvs up comps.xml' % ftp_dir)
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-ftp-admin/scripts/from-incoming.py?r1=1.17&r2=1.18&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-ftp-admin/scripts/gen-indexes.py?r1=1.25&r2=1.26&f=u



More information about the pld-cvs-commit mailing list