patch: do not strip repo tags when modifying a repo
Michael Schroeder <[email protected]> Mon, 14 Apr 2014 18:48:22 +0200
| Newsgroups | gmane.linux.rpm.metadata |
|---|---|
| Message-ID | <[email protected]> |
--AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, currently the yum code does not parse the 'repo' sub-element in repomd.xml, i.e. createrepo can write those tags but modifyrepo will remove them again. The attached patch adds support for 'repo' to the repomd.xml parser and also makes the 'dump' method print it. Cheers, Michael. -- Michael Schroeder [email protected] SUSE LINUX Products GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} --AhhlLboLdkugWU4S Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="yum_repotags.diff" --- ./yum/repoMDObject.py.orig 2014-04-14 16:38:41.520300670 +0000 +++ ./yum/repoMDObject.py 2014-04-14 16:40:58.680570788 +0000 @@ -187,6 +187,8 @@ class RepoMD: child_name = ns_cleanup(child.tag) if child_name == 'content': self.tags['content'].add(child.text) + if child_name == 'repo': + self.tags['repo'].add(child.text) if child_name == 'distro': cpeid = child.attrib.get('cpeid', '') distro = self.tags['distro'].setdefault(cpeid,set()) @@ -218,6 +220,8 @@ class RepoMD: print 'revision: %s' % self.revision if self.tags['content']: print 'tags content: %s' % ", ".join(sorted(self.tags['content'])) + if self.tags['repo']: + print 'tags repo: %s' % ", ".join(sorted(self.tags['repo'])) if self.tags['distro']: for distro in sorted(self.tags['distro']): print 'tags distro: %s' % distro --AhhlLboLdkugWU4S Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Rpm-metadata mailing list [email protected] http://lists.baseurl.org/mailman/listinfo/rpm-metadata --AhhlLboLdkugWU4S--