Change baseurl of "old" packages on update, when baseurl specified
authorDennis Gregorovic <dgregor@redhat.com>
Wed, 6 Jan 2010 20:26:58 +0000 (15:26 -0500)
committerJames Antill <james@and.org>
Wed, 6 Jan 2010 20:26:58 +0000 (15:26 -0500)
createrepo/__init__.py

index 77a03ee67ec242cbb6b92a67e980f4ce05f6f206..0ffe6cb39191cae1432b19e7120d398011404ca9 100644 (file)
@@ -543,6 +543,17 @@ class MetaDataGenerator:
                                       (othernode, self.otherfile)):
                     if node is None:
                         break
+
+                    if self.conf.baseurl:
+                        anode = node.children
+                        while anode is not None:
+                            if anode.type != "element":
+                                anode = anode.next
+                                continue
+                            if anode.name == "location":
+                                anode.setProp('xml:base', self.conf.baseurl)
+                            anode = anode.next
+
                     output = node.serialize('UTF-8', self.conf.pretty)
                     if output:
                         outfile.write(output)