[Yum-devel] [PATCH] Always convert size parameter of _getFile to type int (if not None).
Sascha Peilicke
saschpe at suse.de
Mon Jan 16 16:38:55 UTC 2012
On 01/16/2012 02:44 PM, Zdenek Pavlas wrote:
>> --- a/yum/yumRepo.py
>> +++ b/yum/yumRepo.py
>> if size:
>> + size = int(size)
>> dirstat = os.statvfs(os.path.dirname(local))
>> avail = dirstat.f_bavail * dirstat.f_bsize
>
> ACK, but..
>
> I was looking at this some time ago. There are 10+ places
> where Yum checks if size != None and then int/long(size)..
> I think we should deal with it sooner, and the only place
> I found where size is set to a string is:
>
> diff --git a/yum/repoMDObject.py b/yum/repoMDObject.py
> index 31b1080..e7026f9 100755
> --- a/yum/repoMDObject.py
> +++ b/yum/repoMDObject.py
> @@ -66,7 +66,7 @@ class RepoData:
> elif child_name == 'database_version':
> self.dbversion = child.text
> elif child_name == 'size':
> - self.size = child.text
> + self.size = int(child.text)
> elif child_name == 'open-size':
> self.opensize = child.text
>
> Is this the case? (Package parsed from xml metadata)?
Yes, this was the case
--
With kind regards,
Sascha Peilicke
SUSE Linux GmbH, Maxfeldstr. 5, D-90409 Nuernberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer HRB 16746 (AG Nürnberg)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20120116/1da0c1bc/attachment.asc>
More information about the Yum-devel
mailing list