Hello community, here is the log from the commit of package createrepo for openSUSE:Factory checked in at Fri May 1 02:19:04 CEST 2009. -------- --- createrepo/createrepo.changes 2009-01-25 22:20:53.000000000 +0100 +++ createrepo/createrepo.changes 2009-04-30 11:56:05.763509658 +0200 @@ -1,0 +2,9 @@ +Thu Apr 30 11:02:57 CEST 2009 - lrupp@suse.de + +- fix createrepo-0.4.11-hashfix.patch: + + sha() is also deprecated + + allow usage on older python versions +- review/port all patches to the current 0.4.11 version +- added rpmlintrc to avoid rpmlint warning for libxml2-python + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- createrepo-0.4.10-cachefix.patch createrepo-0.4.10-fixsymlinks.patch createrepo-0.4.8-cache_utime.patch createrepo-license-to-confirm.patch createrepo-missing-tags.patch createrepo-suse-changelogs.patch modifyrepo-prettyxml.patch New: ---- createrepo-0.4.11-cachefix.patch createrepo-0.4.11-cache_utime.patch createrepo-0.4.11-fixsymlinks.patch createrepo-0.4.11-license-to-confirm.patch createrepo-0.4.11-missing-tags.patch createrepo-0.4.11-modifyrepo-prettyxml.patch createrepo-0.4.11-suse-changelogs.patch createrepo-rpmlintrc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ createrepo.spec ++++++ --- /var/tmp/diff_new_pack.S21385/_old 2009-05-01 02:14:57.000000000 +0200 +++ /var/tmp/diff_new_pack.S21385/_new 2009-05-01 02:14:57.000000000 +0200 @@ -21,20 +21,21 @@ Name: createrepo BuildRequires: python Version: 0.4.11 -Release: 79 +Release: 81 License: GPL v2 or later Summary: Creates a Common Metadata Repository Group: System/Packages Source: %{name}-%{version}.tar.bz2 -Patch: %{name}-missing-tags.patch -Patch1: %{name}-suse-changelogs.patch -Patch2: modifyrepo-prettyxml.patch -Patch3: %{name}-0.4.8-cache_utime.patch -Patch5: %{name}-0.4.10-fixsymlinks.patch -Patch6: %{name}-0.4.10-cachefix.patch -Patch7: %{name}-license-to-confirm.patch -Patch8: %{name}-0.4.11-hashfix.patch -Patch9: %{name}-0.4.11-filenamefix.patch +Source1: createrepo-rpmlintrc +Patch: createrepo-0.4.11-missing-tags.patch +Patch1: createrepo-0.4.11-suse-changelogs.patch +Patch2: createrepo-0.4.11-modifyrepo-prettyxml.patch +Patch3: createrepo-0.4.11-cache_utime.patch +Patch4: createrepo-0.4.11-fixsymlinks.patch +Patch5: createrepo-0.4.11-cachefix.patch +Patch6: createrepo-0.4.11-license-to-confirm.patch +Patch7: createrepo-0.4.11-hashfix.patch +Patch8: createrepo-0.4.11-filenamefix.patch Url: http://linux.duke.edu/metadata/ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch @@ -62,16 +63,16 @@ %patch1 %patch2 %patch3 -%patch5 -p1 +%patch4 +%patch5 %patch6 %patch7 -%if %{suse_version} > 1010 -%patch8 -%endif %if %{suse_version} > 1100 -%patch9 +%patch8 %endif +%build + %install %if %{suse_version} <= 1010 sed -e "s,rpm.RPMTAG_ENHANCESNAME,1159," \ @@ -98,6 +99,12 @@ %{_datadir}/%{name}/* %changelog +* Thu Apr 30 2009 lrupp@suse.de +- fix createrepo-0.4.11-hashfix.patch: + + sha() is also deprecated + + allow usage on older python versions +- review/port all patches to the current 0.4.11 version +- added rpmlintrc to avoid rpmlint warning for libxml2-python * Sun Jan 25 2009 cthiel@suse.de - Fix DeprecationWarnings (bnc#467934, bnc#458460). Thanks to Dmitry Mittov for the patches. @@ -185,7 +192,7 @@ * Tolerate unknown files in repodata dirs * patch to support --noepoch for use with old versions of rpm - remove python-urlgrabber dependency -* Tue May 23 2006 cthiel@suse.de +* Wed May 24 2006 cthiel@suse.de - added license-to-confirm.patch (by Jose Mercado <jose@novell.com>) * adds license-to-confirm element for packages which have EULAs * Wed Mar 22 2006 cthiel@suse.de @@ -208,7 +215,7 @@ Suggests, and Recommends rpm tags in the metadata. * Wed Jan 25 2006 mls@suse.de - converted neededforbuild to BuildRequires -* Wed Sep 28 2005 dmueller@suse.de +* Thu Sep 29 2005 dmueller@suse.de - add norootforbuild * Wed Sep 28 2005 cthiel@suse.de - use cachedir relative to package directory, if cachedir isn't an aboslute ++++++ createrepo-0.4.10-cachefix.patch -> createrepo-0.4.11-cachefix.patch ++++++ --- createrepo/createrepo-0.4.10-cachefix.patch 2008-07-23 18:22:13.000000000 +0200 +++ createrepo/createrepo-0.4.11-cachefix.patch 2009-04-30 11:29:26.083513205 +0200 @@ -1,6 +1,8 @@ ---- dumpMetadata.py +Index: dumpMetadata.py +=================================================================== +--- dumpMetadata.py.orig +++ dumpMetadata.py -@@ -603,8 +603,8 @@ +@@ -605,8 +605,8 @@ class RpmMetaData: t.append("".join(self.hdr[rpm.RPMTAG_SIGGPG])) if type(self.hdr[rpm.RPMTAG_SIGPGP]) is not types.NoneType: t.append("".join(self.hdr[rpm.RPMTAG_SIGPGP])) @@ -10,3 +12,4 @@ + t.append("".join(self.hdr[rpm.RPMTAG_SHA1HEADER])) key = md5.new("".join(t)).hexdigest() + ++++++ createrepo-0.4.8-cache_utime.patch -> createrepo-0.4.11-cache_utime.patch ++++++ --- createrepo/createrepo-0.4.8-cache_utime.patch 2008-07-23 18:22:13.000000000 +0200 +++ createrepo/createrepo-0.4.11-cache_utime.patch 2009-04-30 11:23:28.932019017 +0200 @@ -1,11 +1,12 @@ ---- dumpMetadata.py +Index: dumpMetadata.py +=================================================================== +--- dumpMetadata.py.orig +++ dumpMetadata.py -@@ -614,7 +614,7 @@ +@@ -618,6 +618,7 @@ class RpmMetaData: csumo = open(csumfile, 'r') checksum = csumo.readline() csumo.close() -- + os.path.os.utime(csumfile, None) + else: checksum = getChecksum(self.options['sumtype'], fo) - csumo = open(csumfile, 'w') ++++++ createrepo-0.4.11-filenamefix.patch ++++++ --- /var/tmp/diff_new_pack.S21385/_old 2009-05-01 02:14:57.000000000 +0200 +++ /var/tmp/diff_new_pack.S21385/_new 2009-05-01 02:14:57.000000000 +0200 @@ -1,6 +1,8 @@ ---- dumpMetadata.py 2008-12-03 14:08:45.000000000 +0600 -+++ dumpMetadata.py 2009-01-21 18:13:17.000000000 +0600 -@@ -45,7 +44,7 @@ +Index: dumpMetadata.py +=================================================================== +--- dumpMetadata.py.orig ++++ dumpMetadata.py +@@ -44,7 +44,7 @@ class GzipFile(gzip.GzipFile): def _write_gzip_header(self): self.fileobj.write('\037\213') # magic header self.fileobj.write('\010') # compression method @@ -9,4 +11,3 @@ flags = 0 if fname: flags = FNAME - ++++++ createrepo-0.4.10-fixsymlinks.patch -> createrepo-0.4.11-fixsymlinks.patch ++++++ --- createrepo/createrepo-0.4.10-fixsymlinks.patch 2008-07-23 18:22:13.000000000 +0200 +++ createrepo/createrepo-0.4.11-fixsymlinks.patch 2009-04-30 11:28:00.443514600 +0200 @@ -1,10 +1,14 @@ ---- createrepo/genpkgmetadata.py.20070803 2007-06-07 06:33:34.000000000 -0400 -+++ createrepo/genpkgmetadata.py 2007-08-03 15:36:17.000000000 -0400 -@@ -83,11 +83,15 @@ +Index: genpkgmetadata.py +=================================================================== +--- genpkgmetadata.py.orig ++++ genpkgmetadata.py +@@ -99,9 +99,13 @@ class MetaDataGenerator: def extension_visitor(filelist, dirname, names): for fn in names: - if os.path.isdir(fn): +- continue +- if self.cmds['skip-symlinks'] and os.path.islink(fn): + if os.path.islink(dirname + '/' + fn): + if self.cmds['skip-symlinks']: + continue @@ -13,14 +17,9 @@ + continue + elif os.path.isdir(dirname + '/' + fn): continue -- if self.cmds['skip-symlinks'] and os.path.islink(fn): -- continue -- elif fn[-extlen:].lower() == '%s' % (ext): -+ if fn[-extlen:].lower() == '%s' % (ext): + elif fn[-extlen:].lower() == '%s' % (ext): relativepath = dirname.replace(startdir, "", 1) - relativepath = relativepath.lstrip("/") - filelist.append(os.path.join(relativepath,fn)) -@@ -325,9 +329,15 @@ +@@ -345,9 +349,15 @@ class SplitMetaDataGenerator(MetaDataGen def extension_visitor(arg, dirname, names): for fn in names: ++++++ createrepo-0.4.11-hashfix.patch ++++++ --- /var/tmp/diff_new_pack.S21385/_old 2009-05-01 02:14:57.000000000 +0200 +++ /var/tmp/diff_new_pack.S21385/_new 2009-05-01 02:14:57.000000000 +0200 @@ -1,33 +1,52 @@ ---- dumpMetadata.py 2008-12-03 14:08:45.000000000 +0600 -+++ dumpMetadata.py 2009-01-21 18:13:17.000000000 +0600 -@@ -22,8 +22,7 @@ +Index: dumpMetadata.py +=================================================================== +--- dumpMetadata.py.orig ++++ dumpMetadata.py +@@ -22,8 +22,6 @@ import glob import os import rpm import exceptions -import md5 -import sha -+import hashlib import types import struct import re -@@ -124,9 +123,9 @@ +@@ -124,9 +122,21 @@ def getChecksum(sumtype, file, CHUNK=2** fo = open(file, 'rb', CHUNK) if sumtype == 'md5': - sum = md5.new() -+ sum = hashlib.md5() ++ try: ++ import hashlib ++ sum = hashlib.md5() ++ except ImportError: ++ # for Python < 2.6 ++ import md5 ++ sum = md5.new() elif sumtype == 'sha': - sum = sha.new() -+ sum = hashlib.sha1() ++ try: ++ import hashlib ++ sum = hashlib.sha1() ++ except ImportError: ++ # for Python < 2.6 ++ import sha ++ sum = sha.new() else: raise MDError, 'Error Checksumming file, wrong checksum type %s' % sumtype chunk = fo.read -@@ -609,7 +608,7 @@ +@@ -609,7 +619,13 @@ class RpmMetaData: if type(self.hdr[rpm.RPMTAG_SHA1HEADER]) is not types.NoneType: t.append("".join(self.hdr[rpm.RPMTAG_SHA1HEADER])) - key = md5.new("".join(t)).hexdigest() -+ key = hashlib.md5("".join(t)).hexdigest() ++ try: ++ import hashlib ++ key = hashlib.md5("".join(t)).hexdigest() ++ except ImportError: ++ # for Python < 2.6 ++ import md5 ++ key = md5.new("".join(t)).hexdigest() csumtag = '%s-%s-%s-%s' % (os.path.basename(self.relativepath), self.hdr[rpm.RPMTAG_SHA1HEADER], ++++++ createrepo-0.4.11-license-to-confirm.patch ++++++ Index: dumpMetadata.py =================================================================== --- dumpMetadata.py.orig +++ dumpMetadata.py @@ -18,6 +18,7 @@ # $Id$ +import glob import os import rpm import exceptions @@ -630,7 +631,7 @@ class RpmMetaData: -def generateXML(doc, node, formatns, rpmObj, sumtype): +def generateXML(doc, node, formatns, susens, rpmObj, sumtype): """takes an xml doc object and a package metadata entry node, populates a package node with the md information""" ns = node.ns() @@ -664,6 +665,27 @@ def generateXML(doc, node, formatns, rpm if rpmObj.localurl is not None: location.newProp('xml:base', rpmObj.localurl) location.newProp('href', rpmObj.relativepath) + + eulas = glob.glob("%s.eula.*" % os.path.join(rpmObj.options['basedir'], rpmObj.relativepath)) + if eulas is not None: + for eula in eulas: + match = re.match("(.*eula)\.(.*)", eula) + lang = match.group(2) + + eulaContent = None + + try: + fd = open(eula, "r") + eulaContent = fd.read() + fd.close() + except IOError: + raise MDError, "Failed read contents of %s" % eula + + if eulaContent is not None: + eulaNode = pkgNode.newChild(susens, 'license-to-confirm', None) + eulaNode.newProp('lang', lang) + eulaNode.addContent(utf8String(eulaContent)) + format = pkgNode.newChild(ns, 'format', None) for tag in ['license', 'vendor', 'group', 'buildhost', 'sourcerpm']: value = rpmObj.tagByName(tag) Index: genpkgmetadata.py =================================================================== --- genpkgmetadata.py.orig +++ genpkgmetadata.py @@ -181,11 +181,12 @@ class MetaDataGenerator: self.baseroot = self.basedoc.newChild(None, "metadata", None) basens = self.baseroot.newNs('http://linux.duke.edu/metadata/common', None) self.formatns = self.baseroot.newNs('http://linux.duke.edu/metadata/rpm', 'rpm') + self.susens = self.baseroot.newNs('http://novell.com/package/metadata/suse/common', 'suse') self.baseroot.setNs(basens) basefilepath = os.path.join(self.cmds['outputdir'], self.cmds['tempdir'], self.cmds['primaryfile']) self.basefile = _gzipOpen(basefilepath, 'w') self.basefile.write('<?xml version="1.0" encoding="UTF-8"?>\n') - self.basefile.write('<metadata xmlns="http://linux.duke.edu/metadata/common" xmlns:rpm="http://linux.duke.edu/metadata/rpm" packages="%s">\n' % + self.basefile.write('<metadata xmlns="http://linux.duke.edu/metadata/common" xmlns:rpm="http://linux.duke.edu/metadata/rpm" xmlns:suse="http://novell.com/package/metadata/suse/common" packages="%s">\n' % self.pkgcount) def _setupFilelists(self): @@ -223,7 +224,7 @@ class MetaDataGenerator: errorprint('\n%s - %s' % (e, file)) return None try: - basenode = dumpMetadata.generateXML(self.basedoc, self.baseroot, self.formatns, mdobj, self.cmds['sumtype']) + basenode = dumpMetadata.generateXML(self.basedoc, self.baseroot, self.formatns, self.susens, mdobj, self.cmds['sumtype']) except dumpMetadata.MDError, e: errorprint(_('\nAn error occurred creating primary metadata: %s') % e) return None ++++++ createrepo-0.4.11-missing-tags.patch ++++++ Index: dumpMetadata.py =================================================================== --- dumpMetadata.py.orig +++ dumpMetadata.py @@ -292,14 +292,10 @@ class RpmMetaData: return returnflags if type(flags) is not types.ListType: - newflag = flags & 0xf - returnflags.append(newflag) + returnflags.append(flags) else: for flag in flags: - newflag = flag - if flag is not None: - newflag = flag & 0xf - returnflags.append(newflag) + returnflags.append(flag) return returnflags def _checkPreReq(self, flags): @@ -541,37 +537,49 @@ class RpmMetaData: if names is not None: lst = zip(names, flags, ver, prereq) return self._uniq(lst) - - def obsoletesList(self): + + def tagsList(self, name, flags, version): lst = [] - names = self.hdr[rpm.RPMTAG_OBSOLETENAME] - tmpflags = self.hdr[rpm.RPMTAG_OBSOLETEFLAGS] + names = self.hdr[name] + tmpflags = self.hdr[flags] flags = self._correctFlags(tmpflags) - ver = self._correctVersion(self.hdr[rpm.RPMTAG_OBSOLETEVERSION]) + ver = self._correctVersion(self.hdr[version]) if names is not None: lst = zip(names, flags, ver) return self._uniq(lst) + def obsoletesList(self): + return self.tagsList(rpm.RPMTAG_OBSOLETENAME, rpm.RPMTAG_OBSOLETEFLAGS, + rpm.RPMTAG_OBSOLETEVERSION) + def conflictsList(self): - lst = [] - names = self.hdr[rpm.RPMTAG_CONFLICTNAME] - tmpflags = self.hdr[rpm.RPMTAG_CONFLICTFLAGS] - flags = self._correctFlags(tmpflags) - ver = self._correctVersion(self.hdr[rpm.RPMTAG_CONFLICTVERSION]) - if names is not None: - lst = zip(names, flags, ver) - return self._uniq(lst) + return self.tagsList(rpm.RPMTAG_CONFLICTNAME, rpm.RPMTAG_CONFLICTFLAGS, + rpm.RPMTAG_CONFLICTVERSION) def providesList(self): - lst = [] - names = self.hdr[rpm.RPMTAG_PROVIDENAME] - tmpflags = self.hdr[rpm.RPMTAG_PROVIDEFLAGS] - flags = self._correctFlags(tmpflags) - ver = self._correctVersion(self.hdr[rpm.RPMTAG_PROVIDEVERSION]) - if names is not None: - lst = zip(names, flags, ver) - return self._uniq(lst) - + return self.tagsList(rpm.RPMTAG_PROVIDENAME, rpm.RPMTAG_PROVIDEFLAGS, + rpm.RPMTAG_PROVIDEVERSION) + + def enhancesList(self): + lst = self.tagsList(rpm.RPMTAG_ENHANCESNAME, rpm.RPMTAG_ENHANCESFLAGS, + rpm.RPMTAG_ENHANCESVERSION) + return [ l for l in lst if not l[1] & rpm.RPMSENSE_STRONG ] + + def supplementsList(self): + lst = self.tagsList(rpm.RPMTAG_ENHANCESNAME, rpm.RPMTAG_ENHANCESFLAGS, + rpm.RPMTAG_ENHANCESVERSION) + return [ l for l in lst if l[1] & rpm.RPMSENSE_STRONG ] + + def suggestsList(self): + lst = self.tagsList(rpm.RPMTAG_SUGGESTSNAME, rpm.RPMTAG_SUGGESTSFLAGS, + rpm.RPMTAG_SUGGESTSVERSION) + return [ l for l in lst if not l[1] & rpm.RPMSENSE_STRONG ] + + def recommendsList(self): + lst = self.tagsList(rpm.RPMTAG_SUGGESTSNAME, rpm.RPMTAG_SUGGESTSFLAGS, + rpm.RPMTAG_SUGGESTSVERSION) + return [ l for l in lst if l[1] & rpm.RPMSENSE_STRONG ] + def changelogLists(self): lst = [] names = self.listTagByName('changelogname') @@ -668,12 +676,18 @@ def generateXML(doc, node, formatns, rpm hr.newProp('end', str(rpmObj.rangeend)) for (lst, nodename) in [(rpmObj.providesList(), 'provides'), (rpmObj.conflictsList(), 'conflicts'), - (rpmObj.obsoletesList(), 'obsoletes')]: + (rpmObj.obsoletesList(), 'obsoletes'), + (rpmObj.enhancesList(), 'enhances'), + (rpmObj.supplementsList(), 'supplements'), + (rpmObj.suggestsList(), 'suggests'), + (rpmObj.recommendsList(), 'recommends')]: if len(lst) > 0: rpconode = format.newChild(formatns, nodename, None) for (name, flags, (e,v,r)) in lst: entry = rpconode.newChild(formatns, 'entry', None) entry.newProp('name', name) + if flags is not None: + flags = flags & 0xf if flags != 0: if flags == 2: arg = 'LT' if flags == 4: arg = 'GT' @@ -695,6 +709,8 @@ def generateXML(doc, node, formatns, rpm for (name, flags, (e,v,r), prereq) in depsList: entry = rpconode.newChild(formatns, 'entry', None) entry.newProp('name', name) + if flags is not None: + flags = flags & 0xf if flags != 0: if flags == 2: arg = 'LT' if flags == 4: arg = 'GT' ++++++ createrepo-0.4.11-modifyrepo-prettyxml.patch ++++++ Index: modifyrepo.py =================================================================== --- modifyrepo.py.orig +++ modifyrepo.py @@ -92,15 +92,22 @@ class RepoMetadata: ## Build the metadata root = self.doc.firstChild + root.appendChild(self.doc.createTextNode(" ")) data = self._insert_element(root, 'data', attrs={ 'type' : mdtype }) + data.appendChild(self.doc.createTextNode("\n ")) self._insert_element(data, 'location', attrs={ 'href' : 'repodata/' + mdname }) + data.appendChild(self.doc.createTextNode("\n ")) self._insert_element(data, 'checksum', attrs={ 'type' : 'sha' }, text=sha.new(newmd).hexdigest()) + data.appendChild(self.doc.createTextNode("\n ")) self._insert_element(data, 'timestamp', text=str(os.stat(destmd).st_mtime)) + data.appendChild(self.doc.createTextNode("\n ")) self._insert_element(data, 'open-checksum', attrs={ 'type' : 'sha' }, text=sha.new(md).hexdigest()) + data.appendChild(self.doc.createTextNode("\n ")) + root.appendChild(self.doc.createTextNode("\n")) print " type =", mdtype print " location =", 'repodata/' + mdname @@ -111,6 +118,7 @@ class RepoMetadata: ## Write the updated repomd.xml outmd = file(self.repomdxml, 'w') self.doc.writexml(outmd) + outmd.write("\n") outmd.close() print "Wrote:", self.repomdxml ++++++ createrepo-0.4.11-suse-changelogs.patch ++++++ Index: dumpMetadata.py =================================================================== --- dumpMetadata.py.orig +++ dumpMetadata.py @@ -785,7 +785,10 @@ def otherXML(doc, node, rpmObj): for (name, time, text) in clogs: clog = pkg.newChild(None, 'changelog', None) clog.addContent(utf8String(text)) - clog.newProp('author', utf8String(name)) + if name == '' or name[0] != '-': + clog.newProp('author', utf8String(name)) + else: + clog.newProp('author', utf8String(name[2:])) clog.newProp('date', str(time)) return pkg ++++++ createrepo-rpmlintrc ++++++ # this is not really a library addFilter("explicit-lib-dependency.*libxml2-python") ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org