[zypp-devel] repodata.c - clarification
Hi I'm writting a patch about the bug: https://bugzilla.novell.com/show_bug.cgi?id=399239 - "YaST's software installation modules should show disk space modification". The patch would be an append in the tooltip on the "Free space" column in the disk usage widget, like "Used XX GB - Installing x MB" or " - Removing x MB". When the user makes a selection for install / removal, I keep a counter of disk usage delta. However I saw that for some packages, the variable zypp::DiskUsageCounter::MountPoint.pkg_size returns 0. Going deeper I saw that "repodata_search" method in "repodata.c" returns in this instruction: for (kp = keyp; (k = *kp++) != 0; ) if (data->keys[k].name == keyname) break; if (k == 0) return; So, for packages like "kernel-rt", "miro" and "kernel-source", I have k == 0, going on no disk usage is computed (no call to pool.c - solver_fill_DU_cb). I'm using the revision 10814 on svn. A quick test case is selecting the "kernel-source" for installation: the disk usage bar does not change (nor the percentage). Is this behaviour wanted (for some condition on Repodata objects) or is it a bug? Is this related to https://bugzilla.novell.com/show_bug.cgi?id=375104 ? Best regards Roberto Mannai -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Hi, On Wed, 20 Aug 2008, Roberto Mannai wrote:
However I saw that for some packages, the variable zypp::DiskUsageCounter::MountPoint.pkg_size returns 0. Going deeper I saw that "repodata_search" method in "repodata.c" returns in this instruction:
for (kp = keyp; (k = *kp++) != 0; ) if (data->keys[k].name == keyname) break; if (k == 0) return;
That's simply searching if this attribute (the one with keyname) exists for the solvable in question. If it returns here it means for that solvable this attribute doesn't exist.
So, for packages like "kernel-rt", "miro" and "kernel-source", I have k == 0, going on no disk usage is computed (no call to pool.c - solver_fill_DU_cb). I'm using the revision 10814 on svn.
You should look at the metadata (use dumpsolv on the solv file in /var/cache/zypp/solv/$REPO/solv for the repository in question). For diskusage it needs to have the "solvable:diskusage" attributes (that's per directory, if you need that per mount-point you need to call some helper functions, e.g. pool_calc_duchanges) or simply "solvable:installsize" (that's the overall installed size of the package), for that no post-processing is required. Ciao, Michael. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Hi Michael On Wed, Aug 20, 2008 at 4:18 PM, Michael Matz <matz@suse.de> wrote:
That's simply searching if this attribute (the one with keyname) exists for the solvable in question. If it returns here it means for that solvable this attribute doesn't exist.
So is it checking if exist the attribute "solvable:diskusage" ?
You should look at the metadata (use dumpsolv on the solv file in /var/cache/zypp/solv/$REPO/solv for the repository in question). For diskusage it needs to have the "solvable:diskusage" attributes (that's per directory, if you need that per mount-point you need to call some helper functions, e.g. pool_calc_duchanges) or simply "solvable:installsize" (that's the overall installed size of the package), for that no post-processing is required.
I just used dumpsolv, thanks for the clarification. I was assuming that all packages have the "diskusage" attribute: why only some packages have it? Does it depend on some rpm tag? BTW, if not all packages have the diskusage attribute, my patch is quite useless :) (at least as a tooltip on the disk usage bar (so per-partition size) on the package selector widget). Ciao Roberto Mannai -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Hi, On Thu, 21 Aug 2008, Roberto Mannai wrote:
You should look at the metadata (use dumpsolv on the solv file in /var/cache/zypp/solv/$REPO/solv for the repository in question). For diskusage it needs to have the "solvable:diskusage" attributes (that's per directory, if you need that per mount-point you need to call some helper functions, e.g. pool_calc_duchanges) or simply "solvable:installsize" (that's the overall installed size of the package), for that no post-processing is required.
I just used dumpsolv, thanks for the clarification. I was assuming that all packages have the "diskusage" attribute: why only some packages have it? Does it depend on some rpm tag?
IIRC currently the detailed diskusage (per directory) is only supported for the susetags format (i.e. the install repositories), not for the rpmmd (XML based) repositories. There is work underway in current SVN to support also diskusage for the XML repositories (e.g. the update repo and all buildservice repos are of that type), but I'm not sure how complete that is. But for one solv file either _all_ packages should have that attribute or none should have it. Otherwise that would be a bug.
BTW, if not all packages have the diskusage attribute, my patch is quite useless :) (at least as a tooltip on the disk usage bar (so per-partition size) on the package selector widget).
It's not totally useless IMHO. Even in the absense of the diskusage attribute you still can know the overall installsize (you just don't know where exactly that space will be used). You could for instance attribute the whole installsize to the partition that holds /usr . Not ideal of course, but still something. (but yes, in the future, eventually, all packages will have a diskusage attribute). Ciao, Michael. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Hi Michael
It's not totally useless IMHO. Even in the absense of the diskusage attribute you still can know the overall installsize (you just don't know where exactly that space will be used). You could for instance attribute the whole installsize to the partition that holds /usr . Not ideal of course, but still something.
Mmm I would prefer to show the real value on the real mount point, despite the fact it currently works only few repos -- besides the fact the patch is already written, of course :) I'll give it a try into yast-devel ML. Thank you very much for all the clarifications. Ciao Roberto -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (2)
-
Michael Matz
-
Roberto Mannai