[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

software=pm_digestmd2

case $software in
     *[A-Z]*)
        echo "Existing method: FAIL"
        ;;
     *)
        echo "Existing method: PASS"
        ;;
esac

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

if [ x"${lcsoftware}" != x"${software}" ]; then
    echo "New method: FAIL"
else
    echo "New method: PASS"
fi
---- 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
-       ;;
-esac
+fi

 case `basename $f` in
        ${software}-${version}-*)

Michael



More information about the users mailing list