Saturday, April 18, 2009

Adventures with SlackPkg - Part I

As a big fan of Slackware, I try to follow the -current branch of this distribution on two of my machines at home.
Doing this is not a good idea on a production machine, as things might stop working. The -current branch is mainly for testing newer versions of packages. The developers of Slackware are usually grateful when receiving feedback if something goes wrong, so that it can be fixed before the new stable release.

I use SlackPkg, a wonderful tool that since long has been included with Slackware as an extra, but since the release of 12.2 is part of the standard installation.
SlackPkg can check for updates to the -current or stable branch and then upgrade or add the available packages and patches.

This week (April 15th) a new version of the 'pkgtools' package was released, fixing some small bugs. While trying to upgrade the package with SlackPkg, it complained that the md5sum was not matching.
After researching some of the code, I found out that in the 'checkpkg' function in /usr/libexec/slackpkg/ the 'MD5ORIGINAL' variable receives the md5sum of both the package to be installed and the source package (source/a/pkgtools/pkgtools-12.34567890-noarch-2.tgz).

A temporary work-around was to disable md5sum checking in SlackPkg, changing CHECKPKG=on to CHECKPKG=off in /etc/slackpkg/slackpkg.conf

I posted the problem at LinuxQuestions and the same day Alan Hicks responded with a patch that basically filters out the source-packages when getting the md5sum.

The trick is in the included 'grep -v'. In /usr/libexec/slackpkg/ the line:
MD5ORIGINAL=$(grep "/${NAMEPKG}$" ${WORKDIR}/CHECKSUMS.md5| cut -f1 -d \ )
was changed to:
MD5ORIGINAL=$(grep "/${NAMEPKG}$" ${WORKDIR}/CHECKSUMS.md5| grep -v '/source/'| cut -f1 -d \ )

It seems to be a rare occurrence of having an installation package and source package with exactly the same name.

The patch lets SlackPkg install the package, but it is still not perfect, as it tries to install it twice.
But I'll leave this to PiterPunk to fix, as it is no serious problem. :-)

Labels: ,


Post a Comment

Subscribe to Post Comments [Atom]

<< Home