[csw-users] Small bug in bin/checkpkg (with test case and patch)

Michael van der Westhuizen r1mikey at gmail.com
Wed Jun 4 11:55:52 CEST 2008

Hi All,

I've found a small bug in bin/checkpkg which prevents pm_digestmd2
from passing checkpkg.

The test case looks like this:
---- snip ----
#!/bin/ksh -p


case $software in
        echo "Existing method: FAIL"
        echo "Existing method: PASS"

lcsoftware=`echo $software | /usr/bin/tr "[A-Z]" "[a-z]"`

if [ x"${lcsoftware}" != x"${software}" ]; then
    echo "New method: FAIL"
    echo "New method: PASS"
---- snip ----

Run on my Solaris 10 u5 box this prints:
[michael at pkgbld csw]$ ~/testbug.ksh
Existing method: FAIL
New method: PASS

A patch for checkpkg follows:

[michael at pkgbld csw]$ svn diff bin/checkpkg
Index: bin/checkpkg
--- bin/checkpkg        (revision 2141)
+++ bin/checkpkg        (working copy)
@@ -142,12 +142,12 @@
 basedir=`sed -n 's/^BASEDIR=//p' $TMPFILE`
 pkgarch=`sed -n 's/^ARCH=//p' $TMPFILE|head -1`

-case $software in
-     *[A-Z]*)
+lcsoftware=`echo $software | /usr/bin/tr "[A-Z]" "[a-z]"`
+if [ x"${lcsoftware}" != x"${software}" ]; then
        echo ERROR: $software must be all lowercase
        exit 1
-       ;;

 case `basename $f` in


More information about the users mailing list