]> TLD Linux GIT Repositories - tld-ftp-admin.git/blobdiff - wwwbin/dump-packagenames.py
- tldized
[tld-ftp-admin.git] / wwwbin / dump-packagenames.py
diff --git a/wwwbin/dump-packagenames.py b/wwwbin/dump-packagenames.py
deleted file mode 100755 (executable)
index 59f9e89..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/python
-
-import os
-import re
-
-import rpm
-
-dirs = ['/home/services/ftp/pld/dists/3.0/PLD/x32/RPMS',
-               '/home/services/ftp/pld/dists/3.0/PLD/i686/RPMS',
-               '/home/services/ftp/pld/dists/3.0/PLD/x86_64/RPMS',
-               '/home/services/ftp/pld/dists/3.0/ready/x32/RPMS',
-               '/home/services/ftp/pld/dists/3.0/ready/i686/RPMS',
-               '/home/services/ftp/pld/dists/3.0/ready/x86_64/RPMS',
-               '/home/services/ftp/pld/dists/3.0/test/x32/RPMS',
-               '/home/services/ftp/pld/dists/3.0/test/i686/RPMS',
-               '/home/services/ftp/pld/dists/3.0/test/x86_64/RPMS']
-
-#dirs = ['/home/services/ftp/pld/dists/3.0/test/x86_64/RPMS']
-
-outname = "/home/pld/admins/th/www/name-srcname.txt"
-
-re_rpm = re.compile(r'.*\.rpm$')
-re_nvr = re.compile('^(.*)-([^-]*)-([^-]*)\.rpm$')
-
-ts = rpm.ts()
-ts.setVSFlags(-1)
-pkgs = {}
-for dir in dirs:
-       for file in os.listdir(dir):
-               if not re_rpm.match(file):
-                       continue
-
-               rpm_file = os.path.join(dir, file)
-
-               fdno = os.open(rpm_file, os.O_RDONLY)
-               try:
-                       hdr = ts.hdrFromFdno(fdno)
-               except Exception, e:
-                       print "hdrFromFdno: %s: %s" % (rpm_file, e)
-                       os.close(fdno)
-                       continue
-               os.close(fdno)
-
-               name = hdr[rpm.RPMTAG_NAME]
-               sourcerpm = hdr[rpm.RPMTAG_SOURCERPM]
-               m = re_nvr.match(sourcerpm)
-               if not m:
-                       print "%s: doesn't match src.rpm file name" % (sourcerpm)
-                       continue
-               srcname = m.group(1)
-               pkgs[name] = srcname
-
-f = open(outname + ".tmp", "w")
-for (pkg, spkg) in pkgs.iteritems():
-       f.write("%s:%s\n" % (pkg, spkg))
-f.close()
-os.chmod(outname + ".tmp", 0644)
-os.rename(outname + ".tmp", outname)
-