Hello community,
here is the log from the commit of package createrepo
checked in at Thu Dec 6 16:37:04 CET 2007.
--------
--- createrepo/createrepo.changes 2007-11-28 16:21:12.000000000 +0100
+++ /mounts/work_src_done/NOARCH/createrepo/createrepo.changes 2007-12-06 16:04:58.337874000 +0100
@@ -1,0 +2,15 @@
+Thu Dec 6 16:13:43 CET 2007 - cthiel@suse.de
+
+- added modifyrepo-prettyxml.patch to prettify xml output of modifyrepo
+
+-------------------------------------------------------------------
+Tue Dec 4 17:46:18 CET 2007 - cthiel@suse.de
+
+- update to version 0.4.11
+ * adds dmd command
+ * adds -i, --pkglist option (use only these files from the directory
+ specified)
+- drop createrepo-0.4.8-try_sqlitecachec.patch and createrepo-dmd.patch
+ (both included upstream)
+
+-------------------------------------------------------------------
Old:
----
createrepo-0.4.10.tar.bz2
createrepo-0.4.8-try_sqlitecachec.patch
createrepo-dmd.patch
New:
----
createrepo-0.4.11.tar.bz2
modifyrepo-prettyxml.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ createrepo.spec ++++++
--- /var/tmp/diff_new_pack.sq4467/_old 2007-12-06 16:36:47.000000000 +0100
+++ /var/tmp/diff_new_pack.sq4467/_new 2007-12-06 16:36:47.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package createrepo (Version 0.4.10)
+# spec file for package createrepo (Version 0.4.11)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -12,17 +12,16 @@
Name: createrepo
BuildRequires: python
-Version: 0.4.10
-Release: 31
+Version: 0.4.11
+Release: 1
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: %{name}-0.4.8-try_sqlitecachec.patch
+Patch2: modifyrepo-prettyxml.patch
Patch3: %{name}-0.4.8-cache_utime.patch
-Patch4: %{name}-dmd.patch
Patch5: %{name}-0.4.10-fixsymlinks.patch
Patch6: %{name}-0.4.10-cachefix.patch
Patch7: %{name}-license-to-confirm.patch
@@ -53,7 +52,6 @@
%patch1
%patch2
%patch3
-%patch4
%patch5 -p1
%patch6
%patch7
@@ -84,6 +82,15 @@
%{_datadir}/%{name}/*
%changelog
+* Thu Dec 06 2007 - cthiel@suse.de
+- added modifyrepo-prettyxml.patch to prettify xml output of modifyrepo
+* Tue Dec 04 2007 - cthiel@suse.de
+- update to version 0.4.11
+ * adds dmd command
+ * adds -i, --pkglist option (use only these files from the directory
+ specified)
+- drop createrepo-0.4.8-try_sqlitecachec.patch and createrepo-dmd.patch
+ (both included upstream)
* Wed Nov 28 2007 - adrian@suse.de
- apply fix from mls to avoid dieing createrepo on not nice formated
changelogs
++++++ createrepo-0.4.10.tar.bz2 -> createrepo-0.4.11.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/createrepo-0.4.10/createrepo.spec new/createrepo-0.4.11/createrepo.spec
--- old/createrepo-0.4.10/createrepo.spec 2007-06-07 12:33:34.000000000 +0200
+++ new/createrepo-0.4.11/createrepo.spec 2007-11-26 21:23:16.000000000 +0100
@@ -1,6 +1,6 @@
Summary: Creates a common metadata repository
Name: createrepo
-Version: 0.4.10
+Version: 0.4.11
Release: 1
License: GPL
Group: System Environment/Base
@@ -36,6 +36,9 @@
%{_mandir}/man8/createrepo.8*
%changelog
+* Mon Nov 26 2007 Seth Vidal <skvidal at fedoraproject.org>
+- 0.4.11
+
* Thu Jun 07 2007 Paul Nasrat <pnasrat at redhat.com>
- 0.4.10
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/createrepo-0.4.10/dmd.py new/createrepo-0.4.11/dmd.py
--- old/createrepo-0.4.10/dmd.py 1970-01-01 01:00:00.000000000 +0100
+++ new/createrepo-0.4.11/dmd.py 2007-11-26 21:23:16.000000000 +0100
@@ -0,0 +1,156 @@
+#!/usr/bin/python
+
+# dmd - Generate and apply deltas between repository metadata
+#
+# Copyright (C) 2007 James Bowes
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+import sys
+from lxml.etree import parse, tostring, Element
+
+
+class MdType(object):
+ def __init__(self, namespace, rootelem):
+ self.ns = "http://linux.duke.edu/metadata/%s" % namespace
+ self.sns = "{%s}" % self.ns
+ self.deltasns = "{http://linux.duke.edu/metadata/delta}"
+ self.root = rootelem
+
+ def get_pkg_id(self, pkg):
+ return pkg.findtext(self.sns + "checksum")
+
+ def make_hash(self, tree):
+ pkgshash = {}
+ for pkg in tree:
+ pkgid = self.get_pkg_id(pkg)
+ pkgshash[pkgid] = pkg
+
+ return pkgshash
+
+ def make_pkg_elem(self, pkgid, pkg):
+ pkgelem = Element("package")
+ pkgelem.set('name', pkg.findtext(self.sns + 'name'))
+ pkgelem.set('arch', pkg.findtext(self.sns + 'arch'))
+ pkgelem.set('pkgid', pkgid)
+ verelem = pkg.find(self.sns + 'version')
+ verelem.tag = "version"
+ pkgelem.append(verelem)
+
+ return pkgelem
+
+ def diff_trees(self, oldtree, newtree):
+ oldpkgs = oldtree.getroot().getchildren()
+ newpkgs = newtree.getroot().getchildren()
+
+ oldpkgshash = self.make_hash(oldpkgs)
+ newpkgshash = self.make_hash(newpkgs)
+
+ diff = Element(self.root,
+ nsmap = {None : self.ns,
+ "rpm" : "http://linux.duke.edu/metadata/rpm",
+ "delta" : "http://linux.duke.edu/metadata/delta"})
+ additions = Element("delta:additions")
+ diff.append(additions)
+ removals = Element("delta:removals")
+
+ diff.append(removals)
+
+ for pkgid, pkg in newpkgshash.iteritems():
+ if not oldpkgshash.has_key(pkgid):
+ additions.append(pkg)
+
+ for pkgid, pkg in oldpkgshash.iteritems():
+ if not newpkgshash.has_key(pkgid):
+ pkgelem = self.make_pkg_elem(pkgid, pkg)
+ removals.append(pkgelem)
+
+ diff.set("packages", str(len(removals) + len(additions)))
+
+ print tostring(diff, pretty_print=True)
+
+ def patch_tree(self, oldtree, deltatree):
+ oldroot = oldtree.getroot()
+ oldpkgs = oldroot.getchildren()
+
+ oldpkgshash = self.make_hash(oldpkgs)
+
+ additions = deltatree.find(self.deltasns + 'additions').getchildren()
+ removals = deltatree.find(self.deltasns + 'removals').getchildren()
+
+ for pkg in additions:
+ pkgid = self.get_pkg_id(pkg)
+ if oldpkgshash.has_key(pkgid):
+ print >> sys.stderr, "Package %s already exists" % pkgid
+ sys.exit(1)
+ oldroot.append(pkg)
+
+ for pkg in removals:
+ pkgid = pkg.get('pkgid')
+ if not oldpkgshash.has_key(pkgid):
+ print >> sys.stderr, "Package %s does not exist" % pkgid
+ sys.exit(1)
+ oldroot.remove(oldpkgshash[pkgid])
+
+ oldcount = int(oldroot.get('packages'))
+ newcount = oldcount + len(additions) - len(removals)
+ oldroot.set('packages', str(newcount))
+ print tostring(oldtree, pretty_print=True)
+
+
+class OtherMdType(MdType):
+ def get_pkg_id(self, pkg):
+ return pkg.get('pkgid')
+
+ def make_pkg_elem(self, pkgid, pkg):
+ pkgelem = Element("package")
+ pkgelem.set('name', pkg.get('name'))
+ pkgelem.set('arch', pkg.get('arch'))
+ pkgelem.set('pkgid', pkgid)
+ verelem = pkg.find(self.sns + 'version')
+ verelem.tag = "version"
+
+ return pkgelem
+
+
+mdtypeinfo = {
+ 'primary' : MdType('common', 'metadata'),
+ 'filelists' : OtherMdType('filelists', 'filelists'),
+ 'other' : OtherMdType('other', 'other'),
+ }
+
+
+def usage(progname):
+ print "usage: %s [diff|patch] MDTYPE FILE1 FILE2" % progname
+ sys.exit()
+
+def main(args):
+ if len(args) != 5:
+ usage(args[0])
+ if args[1] not in ('diff', 'patch'):
+ usage(args[0])
+ if args[2] not in ('primary', 'filelists', 'other'):
+ usage(args[0])
+
+ oldtree = parse(args[3])
+ newtree = parse(args[4])
+
+ if args[1] == 'diff':
+ mdtypeinfo[args[2]].diff_trees(oldtree, newtree)
+ else:
+ mdtypeinfo[args[2]].patch_tree(oldtree, newtree)
+
+if __name__ == "__main__":
+ main(sys.argv)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/createrepo-0.4.10/docs/createrepo.8 new/createrepo-0.4.11/docs/createrepo.8
--- old/createrepo-0.4.10/docs/createrepo.8 2007-06-07 12:33:34.000000000 +0200
+++ new/createrepo-0.4.11/docs/createrepo.8 2007-11-26 21:23:16.000000000 +0100
@@ -18,6 +18,10 @@
Optional output directory (useful for read only media).
.IP "\fB\-x --exclude\fP <package>"
File globs to exclude, can be specified multiple times.
+.IP "\fB\-i --pkglist\fP <filename>"
+specify a text file which contains the complete list of files to
+include in the repository from the set found in the directory. File format is one
+package per line, no wildcards or globs.
.IP "\fB\-q --quiet\fP"
Run quietly.
.IP "\fB\-g --groupfile\fP <groupfile>"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/createrepo-0.4.10/dumpMetadata.py new/createrepo-0.4.11/dumpMetadata.py
--- old/createrepo-0.4.10/dumpMetadata.py 2007-06-07 12:33:34.000000000 +0200
+++ new/createrepo-0.4.11/dumpMetadata.py 2007-11-26 21:23:16.000000000 +0100
@@ -16,7 +16,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Copyright 2004 Duke University
-# $Id: dumpMetadata.py,v 1.48 2007/05/18 15:01:16 pnasrat Exp $
+# $Id$
import os
import rpm
@@ -28,7 +28,10 @@
import re
import stat
import bz2
-import sqlitecachec
+try:
+ import sqlitecachec
+except ImportError:
+ pass
# done to fix gzip randomly changing the checksum
import gzip
@@ -217,9 +220,12 @@
class MDError(exceptions.Exception):
- def __init__(self, args=None):
+ def __init__(self, value=None):
exceptions.Exception.__init__(self)
- self.args = args
+ self.value = value
+
+ def __str__(self):
+ return self.value
@@ -596,7 +602,9 @@
key = md5.new("".join(t)).hexdigest()
- csumtag = '%s-%s' % (self.hdr['name'] , key)
+ csumtag = '%s-%s-%s-%s' % (os.path.basename(self.relativepath),
+ self.hdr[rpm.RPMTAG_SHA1HEADER],
+ self.size, self.mtime)
csumfile = '%s/%s' % (self.options['cachedir'], csumtag)
if os.path.exists(csumfile) and self.mtime <= os.stat(csumfile)[8]:
csumo = open(csumfile, 'r')
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/createrepo-0.4.10/genpkgmetadata.py new/createrepo-0.4.11/genpkgmetadata.py
--- old/createrepo-0.4.10/genpkgmetadata.py 2007-06-07 12:33:34.000000000 +0200
+++ new/createrepo-0.4.11/genpkgmetadata.py 2007-11-26 21:23:16.000000000 +0100
@@ -17,7 +17,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Copyright 2004 Duke University
-# $Id: genpkgmetadata.py,v 1.70 2007/06/07 08:17:46 pnasrat Exp $
+# $Id$
import os
@@ -59,6 +59,7 @@
-c, --cachedir <dir> = specify which dir to use for the checksum cache
-C, --checkts = don't generate repo metadata, if their ctimes are newer
than the rpm ctimes.
+ -i, --pkglist = use only these files from the directory specified
-h, --help = show this help
-V, --version = output version
-p, --pretty = output xml files in pretty format.
@@ -75,6 +76,21 @@
self.pkgcount = 0
self.files = []
+ def _os_path_walk(self, top, func, arg):
+ """Directory tree walk with callback function.
+ copy of os.path.walk, fixes the link/stating problem
+ """
+
+ try:
+ names = os.listdir(top)
+ except os.error:
+ return
+ func(arg, top, names)
+ for name in names:
+ name = os.path.join(top, name)
+ if os.path.isdir(name):
+ self._os_path_walk(name, func, arg)
+
def getFileList(self, basepath, directory, ext):
"""Return all files in path matching ext, store them in filelist,
recurse dirs. Returns a list object"""
@@ -94,7 +110,7 @@
filelist = []
startdir = os.path.join(basepath, directory) + '/'
- os.path.walk(startdir, extension_visitor, filelist)
+ self._os_path_walk(startdir, extension_visitor, filelist)
return filelist
def checkTimeStamps(self, directory):
@@ -138,7 +154,11 @@
#and scan the old repo
self.oldData = readMetadata.MetadataIndex(self.cmds['outputdir'],
basefile, flfile, otherfile, opts)
- files = self.getFileList(self.cmds['basedir'], directory, '.rpm')
+ if self.cmds['pkglist']:
+ files = self.cmds['pkglist']
+ else:
+ files = self.getFileList(self.cmds['basedir'], directory, '.rpm')
+
files = self.trimRpms(files)
self.pkgcount = len(files)
self.openMetadataDocs()
@@ -230,7 +250,7 @@
#scan rpm files
nodes = self._getNodes(file, directory, current)
if nodes is None:
- return
+ continue
basenode, filenode, othernode = nodes
del nodes
if not self.cmds['quiet']:
@@ -414,14 +434,15 @@
cmds['file-pattern-match'] = ['.*bin\/.*', '^\/etc\/.*', '^\/usr\/lib\/sendmail$']
cmds['dir-pattern-match'] = ['.*bin\/.*', '^\/etc\/.*']
cmds['skip-symlinks'] = False
+ cmds['pkglist'] = []
try:
- gopts, argsleft = getopt.getopt(args, 'phqVvndg:s:x:u:c:o:CS', ['help', 'exclude=',
+ gopts, argsleft = getopt.getopt(args, 'phqVvndg:s:x:u:c:o:CSi:', ['help', 'exclude=',
'quiet', 'verbose', 'cachedir=', 'basedir=',
'baseurl=', 'groupfile=', 'checksum=',
'version', 'pretty', 'split', 'outputdir=',
'noepoch', 'checkts', 'database', 'update',
- 'skip-symlinks'])
+ 'skip-symlinks', 'pkglist='])
except getopt.error, e:
errorprint(_('Options Error: %s.') % e)
usage()
@@ -493,7 +514,9 @@
cmds['database'] = True
elif arg in ['-S', '--skip-symlinks']:
cmds['skip-symlinks'] = True
-
+ elif arg in ['-i', '--pkglist']:
+ cmds['pkglist'] = a
+
except ValueError, e:
errorprint(_('Options Error: %s') % e)
usage()
@@ -533,6 +556,16 @@
usage()
cmds['cachedir'] = a
+ if cmds['pkglist']:
+ lst = []
+ pfo = open(cmds['pkglist'], 'r')
+ for line in pfo.readlines():
+ line = line.replace('\n', '')
+ lst.append(line)
+ pfo.close()
+
+ cmds['pkglist'] = lst
+
#setup some defaults
cmds['primaryfile'] = 'primary.xml.gz'
cmds['filelistsfile'] = 'filelists.xml.gz'
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/createrepo-0.4.10/Makefile new/createrepo-0.4.11/Makefile
--- old/createrepo-0.4.10/Makefile 2007-06-07 12:33:34.000000000 +0200
+++ new/createrepo-0.4.11/Makefile 2007-11-26 21:23:16.000000000 +0100
@@ -1,5 +1,5 @@
PACKAGE = createrepo
-VERSION = 0.4.10
+VERSION = 0.4.11
SHELL = /bin/sh
top_srcdir = .
srcdir = .
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/createrepo-0.4.10/modifyrepo.py new/createrepo-0.4.11/modifyrepo.py
--- old/createrepo-0.4.10/modifyrepo.py 2007-06-07 12:33:34.000000000 +0200
+++ new/createrepo-0.4.11/modifyrepo.py 2007-11-26 21:23:16.000000000 +0100
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# $Id: modifyrepo.py,v 1.2 2006/10/22 03:00:42 lmacken Exp $
+# $Id$
#
# This tools is used to insert arbitrary metadata into an RPM repository.
# Example:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/createrepo-0.4.10/README new/createrepo-0.4.11/README
--- old/createrepo-0.4.10/README 2007-06-07 12:33:34.000000000 +0200
+++ new/createrepo-0.4.11/README 2007-11-26 21:23:16.000000000 +0100
@@ -1,13 +1,15 @@
-This program generates an metadata-compliant dir and xml files for a
-repository of rpms.
+This program generates a repodata dir and xml files for a repository of
+rpm packages. This repository is compatible with apt/yum/smart/yast and many
+other package-repository-related tools.
run createrepo -h for usage syntax
-http://linux.duke.edu/metadata/
+http://linux.duke.edu/createrepo/
+
+
+THIS IS THE MAINTENANCE BRANCH. SECURITY/CRITICAL BUG FIXES ONLY.
+This branch is available as 'maintenance' in the git repository.
-anoncvs:
- :pserver:anonymous@devel.linux.duke.edu:/cvsroot/metadata/cvs-root
-module name is 'generate'
++++++ createrepo-license-to-confirm.patch ++++++
--- /var/tmp/diff_new_pack.sq4467/_old 2007-12-06 16:36:47.000000000 +0100
+++ /var/tmp/diff_new_pack.sq4467/_new 2007-12-06 16:36:47.000000000 +0100
@@ -2,13 +2,13 @@
+++ dumpMetadata.py
@@ -18,6 +18,7 @@
- # $Id: dumpMetadata.py,v 1.48 2007/05/18 15:01:16 pnasrat Exp $
+ # $Id$
+import glob
import os
import rpm
import exceptions
-@@ -624,7 +625,7 @@
+@@ -629,7 +630,7 @@
@@ -17,7 +17,7 @@
"""takes an xml doc object and a package metadata entry node, populates a
package node with the md information"""
ns = node.ns()
-@@ -658,6 +659,27 @@
+@@ -663,6 +664,27 @@
if rpmObj.localurl is not None:
location.newProp('xml:base', rpmObj.localurl)
location.newProp('href', rpmObj.relativepath)
@@ -47,7 +47,7 @@
value = rpmObj.tagByName(tag)
--- genpkgmetadata.py
+++ genpkgmetadata.py
-@@ -161,11 +161,12 @@
+@@ -181,11 +181,12 @@
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')
@@ -61,7 +61,7 @@
self.pkgcount)
def _setupFilelists(self):
-@@ -203,7 +204,7 @@
+@@ -223,7 +224,7 @@
errorprint('\n%s - %s' % (e, file))
return None
try:
++++++ modifyrepo-prettyxml.patch ++++++
--- modifyrepo.py
+++ modifyrepo.py
@@ -92,16 +92,25 @@
## 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
print " checksum =", sha.new(newmd).hexdigest()
@@ -111,6 +120,7 @@
## Write the updated repomd.xml
outmd = file(self.repomdxml, 'w')
self.doc.writexml(outmd)
+ outmd.write("\n")
outmd.close()
print "Wrote:", self.repomdxml
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org