[SETUP] gentoolkit-0.1.8, portage-1.9.1 [PROBLEM] `qpkg -c <pkg>` is incorrectly reporting that all md5 checksums failed to match [REASON] qpkg:312 > extracts the stored md5 checksum from the CONTENTS file, as is. qpkg:313-4> calculates a new md5 checksum, but then converts everything to uppercase qpkg:331 > obviously, the comparison between both strings fails [SUGGESTED FIX] remove the following from line 314: | awk '{print toupper($1)}'
I looked again, and my original solution for this bug was misdirected. Looking through the various CONTENTS files under /var/db/pkg, I see that some were written with the md5 checksum converted to upper case (with my original qpkg), and some were written with the md5 checksum unaltered (my current qpkg). A better fix would be to force everything to be upper case (for the comparison), then it will work with new-style and old-style CONTENTS formats: (ignoring indentation) line312: [ "$mcheck" ] && md5=${line[2]} && md5=`echo "$md5" | awk '{print toupper($1)}' ` (of course, the real bug is that qpkg is not writing md5 checksums to the CONTENTS file in the same way as before - the above suggestion just bypasses this)
The qpkg tool seems to have been left high and dry by its original author. I will see if we can't come up with some kind of replacement for it, as I am not willing to hack actively on it given its current state.
For the reason of this here time output, I'm going to have to recommend that we go with the awkless solution originally suggested, and users who's md5s are in all upercase are going to have to deal with it... Doh, just had a thought... I'll be back with you in a moment... I might have an intermediate solution... lost ide-smart-1.4 # time qpkg-new -c -v glibc sys-libs/glibc-2.2.5-r2 * /var/db/pkg/sys-libs/glibc-2.2.5-r2/glibc-2.2.5-r2.ebuild 4623/5118 real 0m12.895s user 0m6.930s sys 0m5.160s lost ide-smart-1.4 # time qpkg-new -c -v glibc sys-libs/glibc-2.2.5-r2 * /var/db/pkg/sys-libs/glibc-2.2.5-r2/glibc-2.2.5-r2.ebuild 4623/5118 real 0m49.536s user 0m18.600s sys 0m27.380s lost ide-smart-1.4 #
I lied, I dun have a better solution... For now at least I'm going to do it with your initial solution of removing the toupper this will work fine on more recent installs, and is something that will over time become less and less of a problem as people upgrade packages.
W00T thanks to my esteemed collegue carpaski I am now using 'tr' instead of awk. AND thanks to me, we now only do that translation on things that fail the md5 check the first time. I also changed -c -v so that it displays the failing files, -c -vv displays EVERYTHING, -c doesn't. I'm closing this now that things work. :-D