[Yum-devel] RFC: repomd.xml addition of size element for the data/files

James Antill james.antill at redhat.com
Tue Jun 17 05:22:52 UTC 2008

 What does everyone think of adding an optional size child element to
the repomd.xml <data> element. I'm thinking something like this
createrepo patch (tested):

diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 93d094a..a14bbd1 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -699,6 +699,8 @@ class MetaDataGenerator:
             checksum = data.newChild(None, 'checksum', csum)
             checksum.newProp('type', sumtype)
             timestamp = data.newChild(None, 'timestamp', str(timestamp))
+            size = os.stat(os.path.join(repopath, file))
+            data.newChild(None, 'size', str(size.st_size))
             unchecksum = data.newChild(None, 'open-checksum', uncsum)
             unchecksum.newProp('type', sumtype)
             location = data.newChild(None, 'location', None)

...which generates things like:

  <data type="primary">
    <checksum type="sha">355dd80c16a91d7f59063274342e4b20d0fda883</checksum>
    <open-checksum type="sha">d7440233906ce9b8779281b09525088771ae6329</open-checksum>
    <location href="repodata/primary.xml.gz"/>

James Antill <james.antill at redhat.com>
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20080617/c9d3de31/attachment.pgp 

More information about the Yum-devel mailing list