[zypp-devel] The download size of a patch in PK zypp backend
Hi All, I found that the download size of a "patch" returned from PK zypp backend is always 0, so the update viewer such as gpk-update-viewer always shows 0 or nothing in the column of "Size". The cause is that PK zypp backend doesn't calculate the download size of a "patch" separately and zypp reports 0 as the download size of a "patch". My idea is to check the kind of the solvable object. If it is a "patch", retrieve the package list of the patch and sum the download sizes of packages and return to gpk-update-viewer. Here comes the pseudo code for backend_get_details_thread() in pk-backend-zypp.cpp. if (package.isSystem ()){ /* Query the local RPM DB */ } else if (package.kind() == zypp::ResKind::patch){ /* It's a patch!!! */ /* Retrieve the package list from the variable "package" */ /* Sum up the download size of the packages in the list */ /* Send the information of the patch */ } else { /* Send the information of the package */ } The problem is: How can I retrieve the package list from a zypp::sat::Solvable object which represents a patch? I tried to trace libzypp but cannot fully understand yet. It seems SolvAttr::updateCollection is what I want, but I don't know which lookup*Attribute() is for the attribute. The version of libzypp is 5.30.12. Any suggestion is appreciated. Thanks, Gary Lin -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (1)
-
Gary Ching-Pang Lin