pld-ftp-admin: wwwbin/ac-th-diff.py (NEW), wwwbin/clean-dups-archive.py (NE...
glen
glen at pld-linux.org
Fri May 4 08:09:46 CEST 2012
Author: glen Date: Fri May 4 06:09:46 2012 GMT
Module: pld-ftp-admin Tag: HEAD
---- Log message:
- import from ~pldth/bin
---- Files affected:
pld-ftp-admin/wwwbin:
ac-th-diff.py (NONE -> 1.1) (NEW), clean-dups-archive.py (NONE -> 1.1) (NEW), clean-dups-old.py (NONE -> 1.1) (NEW), clean-dups.py (NONE -> 1.1) (NEW), clean-test.sh (NONE -> 1.1) (NEW), consistency-check.sh (NONE -> 1.1) (NEW), dump-packagenames.py (NONE -> 1.1) (NEW), freshness.sh (NONE -> 1.1) (NEW), ftp-freshness.py (NONE -> 1.1) (NEW), obsolete-check.sh (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: pld-ftp-admin/wwwbin/ac-th-diff.py
diff -u /dev/null pld-ftp-admin/wwwbin/ac-th-diff.py:1.1
--- /dev/null Fri May 4 08:09:46 2012
+++ pld-ftp-admin/wwwbin/ac-th-diff.py Fri May 4 08:09:41 2012
@@ -0,0 +1,57 @@
+#!/usr/bin/python
+
+import os
+import re
+import struct
+
+acdir = "/home/ftp/pub/Linux/PLD/dists/ac/PLD/SRPMS/SRPMS"
+thdir = "/home/ftp/pub/Linux/PLD/dists/th/PLD/SRPMS/RPMS/"
+
+thpkg = []
+acpkg = []
+
+ign = '^(xorg-.*|X11-.*|XcursorTheme-.*)$'
+re_c = re.compile(ign)
+
+re_n = re.compile('^(.*)-([^-]*)-([^-]*)$')
+
+def getname(file):
+ #f = os.popen('rpm --nomd5 --nodigest --nosignature -qp --queryformat "%{NAME}" ' + file, "r")
+ #name = f.read()
+ #f.close()
+ #f = open(file, 'rb')
+ #rpmlead = f.read(96)
+ #f.close()
+ #data = struct.unpack("6B2h66s2h16s", rpmlead)
+ #name = data[8].strip()
+ #print name
+ m = re_n.match(file)
+ name = m.group(1).strip()
+ return name
+
+for rpm in os.listdir(acdir):
+ if re_c.match(rpm):
+ continue
+ acpkg.append(getname(rpm))
+
+for rpm in os.listdir(thdir):
+ if re_c.match(rpm):
+ continue
+ thpkg.append(getname(rpm))
+
+thpkg.sort()
+acpkg.sort()
+
+print "*****************************************************"
+print "Packages in AC repo that are not in TH repo:"
+for pkg in acpkg:
+ if pkg not in thpkg:
+ print pkg
+
+print
+print
+print "*****************************************************"
+print "Packages in TH repo that are not in AC repo:"
+for pkg in thpkg:
+ if pkg not in acpkg:
+ print pkg
================================================================
Index: pld-ftp-admin/wwwbin/clean-dups-archive.py
diff -u /dev/null pld-ftp-admin/wwwbin/clean-dups-archive.py:1.1
--- /dev/null Fri May 4 08:09:46 2012
+++ pld-ftp-admin/wwwbin/clean-dups-archive.py Fri May 4 08:09:41 2012
@@ -0,0 +1,78 @@
+#!/usr/bin/python
+# arekm, 2008
+# remove
+
+import os
+import re
+import time
+import rpm
+import sys
+
+re_rpm = re.compile(r'.*\.rpm$')
+re_nvr = re.compile('^(.*)-([^-]*)-([^-]*)\.rpm$')
+dir = '/home/pld/admins/th/ftp/.archive/PLD/SRPMS/RPMS'
+
+ts = rpm.TransactionSet("", (rpm._RPMVSF_NOSIGNATURES or rpm.RPMVSF_NOHDRCHK or rpm._RPMVSF_NODIGESTS or rpm.RPMVSF_NEEDPAYLOAD))
+
+def compare(f1, f2):
+ try:
+ fd1 = os.open(os.path.join(dir, f1), os.O_RDONLY)
+ except Exception, e:
+ print e
+ # ignore non-files
+ return 0
+ try:
+ fd2 = os.open(os.path.join(dir, f2), os.O_RDONLY)
+ except Exception, e:
+ print e
+ # ignore non-files
+ return 0
+ h1 = ts.hdrFromFdno(fd1)
+ h2 = ts.hdrFromFdno(fd2)
+ os.close(fd1)
+ os.close(fd2)
+
+ l1 = rpm.versionCompare(h1, h2)
+ l2 = rpm.versionCompare(h2, h1)
+
+ if l1 > 0 and l2 > 0:
+ return 0
+
+ return -l1
+
+
+def find_old(files):
+ return sorted(files, compare)
+
+files = {}
+dupes = {}
+
+for file in os.listdir(dir):
+ if not re_rpm.match(file):
+ continue
+
+ m = re_nvr.match(file)
+ if not m:
+ print "problem with: %s" % file
+ sys.exit(1)
+
+ if len(sys.argv) == 0:
+ p = os.path.join(dir, file)
+ mtime = os.stat(p).st_mtime
+ if mtime > time.time() - 3*86400:
+ continue
+
+ name = m.group(1)
+
+ if files.has_key(name):
+ if dupes.has_key(name):
+ dupes[name].append(file)
+ else:
+ dupes[name] = [ files[name] ]
+ dupes[name].append(file)
+ else:
+ files[name] = file
+
+for i in dupes.iterkeys():
+ for old in find_old(dupes[i])[1:]:
+ os.system("/home/pld/admins/th/pld-ftp-admin/scripts/remove.py .archive/PLD %s" % old)
================================================================
Index: pld-ftp-admin/wwwbin/clean-dups-old.py
diff -u /dev/null pld-ftp-admin/wwwbin/clean-dups-old.py:1.1
--- /dev/null Fri May 4 08:09:46 2012
+++ pld-ftp-admin/wwwbin/clean-dups-old.py Fri May 4 08:09:41 2012
@@ -0,0 +1,69 @@
+#!/usr/bin/python
+# arekm, 2008
+# remove
+
+import os
+import re
+import time
+import rpm
+import sys
+
+re_info = re.compile(r'.*\.info$')
+re_nvr = re.compile('^(.*)-([^-]*)-([^-]*)\.info$')
+dir = '/home/pld/admins/th/ftp/test/SRPMS/.metadata'
+
+def compare(f1, f2):
+ m1 = re_nvr.match(f1)
+ n1 = m1.group(1)
+ v1 = m1.group(2)
+ r1 = m1.group(3)
+
+ m2 = re_nvr.match(f2)
+ n2 = m2.group(1)
+ v2 = m2.group(2)
+ r2 = m2.group(3)
+
+ l1 = rpm.labelCompare((n1, v1, r1), (n2, v2, r2))
+ l2 = rpm.labelCompare((n2, v2, r2), (n1, v1, r1))
+
+ if l1 > 0 and l2 > 0:
+ return 0
+
+ return -l1
+
+
+def find_old(files):
+ return sorted(files, compare)
+
+files = {}
+dupes = {}
+
+for file in os.listdir(dir):
+ if not re_info.match(file):
+ continue
+
+ m = re_nvr.match(file)
+ if not m:
+ print "problem with: %s" % file
+ sys.exit(1)
+
+ if len(sys.argv) == 0:
+ p = os.path.join(dir, file)
+ mtime = os.stat(p).st_mtime
+ if mtime > time.time() - 3*86400:
+ continue
+
+ name = m.group(1)
+
+ if files.has_key(name):
+ if dupes.has_key(name):
+ dupes[name].append(file)
+ else:
+ dupes[name] = [ files[name] ]
+ dupes[name].append(file)
+ else:
+ files[name] = file
+
+for i in dupes.iterkeys():
+ for old in find_old(dupes[i])[1:]:
+ os.system("/home/pld/admins/th/pld-ftp-admin/scripts/remove.py test %s" % old)
================================================================
Index: pld-ftp-admin/wwwbin/clean-dups.py
diff -u /dev/null pld-ftp-admin/wwwbin/clean-dups.py:1.1
--- /dev/null Fri May 4 08:09:47 2012
+++ pld-ftp-admin/wwwbin/clean-dups.py Fri May 4 08:09:41 2012
@@ -0,0 +1,92 @@
+#!/usr/bin/python
+# arekm, 2008
+# remove
+
+import os
+import re
+import time
+import rpm
+import sys
+
+re_rpm = re.compile(r'.*\.rpm$')
+re_nvr = re.compile('^(.*)-([^-]*)-([^-]*)\.rpm$')
+dir = '/home/pld/admins/th/ftp/test/SRPMS/RPMS'
+
+ts = rpm.TransactionSet("", (rpm._RPMVSF_NOSIGNATURES or rpm.RPMVSF_NOHDRCHK or rpm._RPMVSF_NODIGESTS or rpm.RPMVSF_NEEDPAYLOAD))
+
+def compare(f1, f2):
+ try:
+ fd1 = os.open(os.path.join(dir, f1), os.O_RDONLY)
+ except Exception, e:
+ print e
+ # ignore non-files
+ return 0
+ try:
+ fd2 = os.open(os.path.join(dir, f2), os.O_RDONLY)
+ except Exception, e:
+ print e
+ # ignore non-files
+ return 0
+ try:
+ h1 = ts.hdrFromFdno(fd1)
+ except Exception, e:
+ print "hdrFromFdno for %s failed: %s" % (f1, e)
+ os.close(fd1)
+ os.close(fd2)
+ return 0
+
+ try:
+ h2 = ts.hdrFromFdno(fd2)
+ except Exception, e:
+ print "hdrFromFdno for %s failed: %s" % (f2, e)
+ os.close(fd1)
+ os.close(fd2)
+ return 0
+
+ os.close(fd1)
+ os.close(fd2)
+
+ l1 = rpm.versionCompare(h1, h2)
+ l2 = rpm.versionCompare(h2, h1)
+
+ if l1 > 0 and l2 > 0:
+ return 0
+
+ return -l1
+
+
+def find_old(files):
+ return sorted(files, compare)
+
+files = {}
+dupes = {}
+
+for file in os.listdir(dir):
+ if not re_rpm.match(file):
+ continue
+
+ m = re_nvr.match(file)
+ if not m:
+ print "problem with: %s" % file
+ sys.exit(1)
+
+ if len(sys.argv) == 0:
+ p = os.path.join(dir, file)
+ mtime = os.stat(p).st_mtime
+ if mtime > time.time() - 3*86400:
+ continue
+
+ name = m.group(1)
+
+ if files.has_key(name):
+ if dupes.has_key(name):
+ dupes[name].append(file)
+ else:
+ dupes[name] = [ files[name] ]
+ dupes[name].append(file)
+ else:
+ files[name] = file
+
+for i in dupes.iterkeys():
+ for old in find_old(dupes[i])[1:]:
+ os.system("/home/pld/admins/th/pld-ftp-admin/scripts/remove.py test %s" % old)
================================================================
Index: pld-ftp-admin/wwwbin/clean-test.sh
diff -u /dev/null pld-ftp-admin/wwwbin/clean-test.sh:1.1
--- /dev/null Fri May 4 08:09:47 2012
+++ pld-ftp-admin/wwwbin/clean-test.sh Fri May 4 08:09:41 2012
@@ -0,0 +1,16 @@
+#!/bin/sh
+LC_ALL=C; export LC_ALL
+cd /home/pld/admins/th/ftp/test/SRPMS/.metadata || exit 1
+#for file in `find . -name '*.info' -print`; do
+for file in `find . -name '*.info' -mtime +1 -print`; do
+ dfile=$(basename $file | sed -e 's#^\./##g')
+ if (~/pld-ftp-admin/scripts/test-move.py test ready "$dfile" | grep -q "has only src.rpm built"); then
+ echo "Removing $dfile..."
+ ~/pld-ftp-admin/scripts/remove.py test "$dfile"
+ fi
+done
+for file in `find . -name '*.info' -mtime +100`; do
+ dfile=$(basename $file | sed -e 's#^\./##g')
+ echo "Removing $dfile..."
+ ~/pld-ftp-admin/scripts/remove.py test "$dfile"
+done
================================================================
Index: pld-ftp-admin/wwwbin/consistency-check.sh
diff -u /dev/null pld-ftp-admin/wwwbin/consistency-check.sh:1.1
--- /dev/null Fri May 4 08:09:47 2012
+++ pld-ftp-admin/wwwbin/consistency-check.sh Fri May 4 08:09:41 2012
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+export LC_ALL=C
+
+filter_deps() {
+ grep -Ev "(FileDigestParameterized|unsatisfied dependencies found|-multilib-|zsh/latest/functions|VirtualBox.*libc\.so\.6|obextool.*libc\.so\.6)" | \
+ grep -v "uname(release)" |
+ grep -v "/eclipse/"
+}
+
+group_deps() {
+ local t=$(mktemp)
+ cat > $t
+ sed -ne 's/.*req \(.*\) not found.*/\1/p' $t | sort -u | while read dep; do
+ grep -F "req $dep not found" $t
+ done
+ rm -f $t
+}
+
+gen_list() {
+ date
+ /usr/bin/poldek -O "auto directory dependencies = yes" \
+ --ignore "*-debuginfo-*" --ignore "db4.6*" \
+ --ignore "boost*1.34*" \
+ --ignore "krb5*" \
+ --ignore "libjpeg6*" \
+ --ignore "libpthread-stubs-devel*" \
+ --ignore "monodoc-*" \
+ --ignore "arts-*" --ignore "artsc-*" \
+ --ignore "esound-*" \
+ --ignore "opera-plugin32-*" \
+ --ignore "nspluginwrapper-*" \
+ --ignore "mbrola-voice-*" \
+ --ignore "hal" \
+ --ignore "hal-libs" \
+ --ignore "quicktime4linux*" \
+ --verify=deps -Q "$@" | filter_deps | group_deps | sort
+}
+
+gen_list_uniq() {
+ gen_list -O "unique package names = yes" "$@"
+}
+
+t=$(mktemp)
+ftpdir=$HOME/ftp
+gen_list -s $ftpdir/PLD/x86_64/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ > $t && cat $t > $HOME/www/main.txt
+gen_list_uniq -s $ftpdir/PLD/x86_64/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ -s $ftpdir/ready/x86_64/RPMS/ -s $ftpdir/ready/noarch/RPMS/ > $t && cat $t > $HOME/www/main-ready.txt
+gen_list_uniq -s $ftpdir/PLD/x86_64/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ -s $ftpdir/ready/x86_64/RPMS/ -s $ftpdir/ready/noarch/RPMS/ -s $ftpdir/test/x86_64/RPMS/ -s $ftpdir/test/noarch/RPMS/ > $t && cat $t > $HOME/www/main-ready-test.txt
+
+gen_list -s $ftpdir/PLD/i686/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ > $t && cat $t > $HOME/www/main-i686.txt
+gen_list_uniq -s $ftpdir/PLD/i686/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ -s $ftpdir/ready/i686/RPMS/ -s $ftpdir/ready/noarch/RPMS/ > $t && cat $t > $HOME/www/main-ready-i686.txt
+gen_list_uniq -s $ftpdir/PLD/i686/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ -s $ftpdir/ready/i686/RPMS/ -s $ftpdir/ready/noarch/RPMS/ -s $ftpdir/test/i686/RPMS/ -s $ftpdir/test/noarch/RPMS/ > $t && cat $t > $HOME/www/main-ready-test-i686.txt
+
+gen_list -s $ftpdir/PLD/i486/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ > $t && cat $t > $HOME/www/main-i486.txt
+gen_list_uniq -s $ftpdir/PLD/i486/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ -s $ftpdir/ready/i486/RPMS/ -s $ftpdir/ready/noarch/RPMS/ > $t && cat $t > $HOME/www/main-ready-i486.txt
+gen_list_uniq -s $ftpdir/PLD/i486/RPMS/ -s $ftpdir/PLD/noarch/RPMS/ -s $ftpdir/ready/i486/RPMS/ -s $ftpdir/ready/noarch/RPMS/ -s $ftpdir/test/i486/RPMS/ -s $ftpdir/test/noarch/RPMS/ > $t && cat $t > $HOME/www/main-ready-test-i486.txt
+
+(date; $HOME/bin/ac-th-diff.py) > $t && cat $t > $HOME/www/ac-th-diff.txt
+
+chmod 644 $HOME/www/*.txt
+rm -f $t
================================================================
Index: pld-ftp-admin/wwwbin/dump-packagenames.py
diff -u /dev/null pld-ftp-admin/wwwbin/dump-packagenames.py:1.1
--- /dev/null Fri May 4 08:09:47 2012
+++ pld-ftp-admin/wwwbin/dump-packagenames.py Fri May 4 08:09:41 2012
@@ -0,0 +1,59 @@
+#!/usr/bin/python
+
+import os
+import re
+
+import rpm
+
+dirs = ['/home/services/ftp/pld/dists/3.0/PLD/i486/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/i486/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/i486/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)
+
================================================================
Index: pld-ftp-admin/wwwbin/freshness.sh
diff -u /dev/null pld-ftp-admin/wwwbin/freshness.sh:1.1
--- /dev/null Fri May 4 08:09:47 2012
+++ pld-ftp-admin/wwwbin/freshness.sh Fri May 4 08:09:41 2012
@@ -0,0 +1,6 @@
+#!/bin/sh
+date > $HOME/www/freshness.txt.new
+$HOME/bin/ftp-freshness.py >> $HOME/www/freshness.txt.new 2>&1
+chmod 644 $HOME/www/freshness.txt.new
+mv $HOME/www/freshness.txt.new $HOME/www/freshness.txt
+
================================================================
Index: pld-ftp-admin/wwwbin/ftp-freshness.py
diff -u /dev/null pld-ftp-admin/wwwbin/ftp-freshness.py:1.1
--- /dev/null Fri May 4 08:09:47 2012
+++ pld-ftp-admin/wwwbin/ftp-freshness.py Fri May 4 08:09:41 2012
@@ -0,0 +1,136 @@
+#!/usr/bin/python
+# arekm, 2007
+
+import os
+import re
+import struct
+import rpm
+import subprocess
+
+# earlier == more important
+dirs = [ "/home/ftp/pub/Linux/PLD/dists/th/test/SRPMS/RPMS/",
+ "/home/ftp/pub/Linux/PLD/dists/th/ready/SRPMS/RPMS/",
+ "/home/ftp/pub/Linux/PLD/dists/th/PLD/SRPMS/RPMS/" ]
+#dirs = [ "/home/pld/admins/th/1" ]
+cvsdir = "/home/pld/admins/th/"
+
+cmd = ['cvs', '-Q', '-z3', '-d:pserver:cvs at cvs.pld-linux.org:/cvsroot', 'ls', '-l', 'packages']
+p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+(out, err) = p.communicate(None)
+re_dir = re.compile('^(.*)\s+\(directory\)')
+packages = []
+i = 0
+j = 0
+for line in out.split('\n'):
+ m = re_dir.match(line)
+ if not m:
+ continue
+ if j == 0:
+ packages.append([])
+ spec = m.group(1).strip()
+ packages[i].append('packages/' + spec + '/' + spec + '.spec')
+ j = j + 1
+ if j > 100:
+ i = i + 1
+ j = 0
+
+os.chdir(cvsdir)
+for p in packages:
+ cmd = ['cvs', '-Q', '-z3', '-d:pserver:cvs at cvs.pld-linux.org:/cvsroot', 'co'] + p
+ ret = subprocess.call(cmd)
+
+class Pkgs(object):
+ def __init__(self):
+ self.pkg = {}
+ self.cvs = {}
+ self.cvs_new_nvr = []
+ self.cvs_new_nv = []
+ self.re_n = re.compile('^(.*)-([^-]*)-([^-]*)\.src\.rpm$')
+
+ def __get_from_rpm(self, file_name):
+ m = self.re_n.match(file_name)
+ if not m:
+ return False
+ name = m.group(1).strip()
+ version = m.group(2).strip()
+ release = m.group(3).strip()
+ return (name, version, release)
+
+ def __get_from_cvs(self, name):
+ f = os.popen('rpm --specfile -q --queryformat "%{name}\n%{version}\n%{release}\n" ' + cvsdir + '/packages/' + name + '/' + name + '.spec 2> /dev/null', 'r')
+ name = f.readline().strip()
+ version = f.readline().strip()
+ release = f.readline().strip()
+ f.close()
+ return (name, version, release)
+
+ def __update_cvs(self, name):
+ if not self.cvs.has_key(name):
+ self.cvs[name] = self.__get_from_cvs(name)
+
+ def __update_new(self, name):
+ cvs_nvr = self.cvs[name]
+ pkg_nvr = self.pkg[name]
+
+ cvs_rpm_vr = rpm.labelCompare((cvs_nvr[0], cvs_nvr[1], cvs_nvr[2]), (pkg_nvr[0], pkg_nvr[1], pkg_nvr[2]))
+ cvs_rpm_v = rpm.labelCompare((cvs_nvr[0], cvs_nvr[1], ""), (pkg_nvr[0], pkg_nvr[1], ""))
+ rpm_cvs_vr = rpm.labelCompare((pkg_nvr[0], pkg_nvr[1], pkg_nvr[2]), (cvs_nvr[0], cvs_nvr[1], cvs_nvr[2]))
+ rpm_cvs_v = rpm.labelCompare((pkg_nvr[0], pkg_nvr[1], ""), (cvs_nvr[0], cvs_nvr[1], ""))
+
+ if rpm_cvs_v < 0 and cvs_rpm_v > 0:
+ self.cvs_new_nv.append(name)
+ else:
+ if rpm_cvs_vr < 0 and cvs_rpm_vr > 0 and cvs_nvr[1] == pkg_nvr[1]:
+ self.cvs_new_nvr.append(name)
+
+ def prepare(self):
+ self.cvs_new_nvr.sort()
+ self.cvs_new_nvr = list(set(self.cvs_new_nvr))
+ self.cvs_new_nv.sort()
+ self.cvs_new_nv = list(set(self.cvs_new_nv))
+
+ pkgs = list(self.pkg) + list(self.cvs)
+
+ for name in list(set(pkgs)):
+ self.__update_new(name)
+
+ def add_rpm(self, file_name):
+ nvr = self.__get_from_rpm(file_name)
+ if not nvr:
+ return False
+ name = nvr[0]
+ if self.pkg.has_key(name):
+ if rpm.labelCompare(nvr, self.pkg[name]) > 0:
+ del self.pkg[name]
+ self.pkg[name] = nvr
<<Diff was trimmed, longer than 597 lines>>
More information about the pld-cvs-commit
mailing list