OpenCSW Bug Tracker


Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002869 [cswutils] regular use minor always 2008-04-29 09:46 2009-08-13 10:29
Reporter clarkema View Status public  
Assigned To dam
Priority normal Resolution fixed  
Status closed  
Summary 0002869: createpkg and checkpkg exit with \'ERROR: $software must be all lowercase\', even if the software name _is_ all lowercase.
Description clarkema@desktop03:~/sgdsync/solaris> cat /etc/release
                       Solaris 10 8/07 s10s_u4wos_12b SPARC
           Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
                        Use is subject to license terms.
                            Assembled 16 August 2007

clarkema@desktop03:~/sgdsync/solaris> grep NAME pkginfo
NAME=sgdsync - SGD application and server management tool.
clarkema@desktop03:~/sgdsync/solaris> createpkg -r ..
i copyright
ERROR: sgdsync must be all lowercase
Additional Information It seems that the current check for \'lowercase-ness\' in createpkg and checkpkg doesn\'t work. The following patch appears to fix the issue, although it has not been exhaustively tested:

603 clarkema@desktop03:~/sgdsync/solaris> diff -U3 `which createpkg` ~clarkema/createpkg
--- /opt/csw/bin/createpkg Mon Nov 22 20:40:35 2004
+++ /home/clarkema/createpkg Tue Apr 29 14:10:36 2008
@@ -87,12 +87,8 @@
 PKGREV=`sed -n \'s/^VERSION=//p\' pkginfo`
 SOFTNAME=`sed -n \'s/^NAME=//p\' pkginfo|awk \'{print $1}\'`
 
-case $SOFTNAME in
- *[A-Z]*)
- echo ERROR: $SOFTNAME must be all lowercase
- exit 1
- ;;
-esac
+echo $SOFTNAME | grep \'[A-Z]\' > /dev/null \\
+ && die $SOFTNAME must be all lowercase
 
 PKGFILE=$SOFTNAME-$PKGREV-SunOS`uname -r`-$ARCH-CSW.pkg

The same needs to be done to checkpkg.
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0006534)
james (reporter)
2009-08-07 20:39

Please fix this, I'm sick of editing checkpkg and createpkg.

Below is a fix based on typeset. I can't see why the [A-Z] does not always work, it could be something to do with charsets, LC, LANGs, whatever typeset works everywhere for me, including with accented chars: 'É' (compose E '), probably want to block anything that isn't "[a-z]*" and not just upper anyway!

isLower(){
    typeset -l LOWER=$1
    [ "$LOWER" = "$1" ]
}


if ! isLower $SOFTWARE ; then
       echo ERROR: $SOFTNAME must be all lowercase
       exit 1
fi
(0006538)
dam (administrator)
2009-08-07 23:24

Thanks for the patch! An updated version of createpkg and checkpkg is in testing at
  cswutils-1.14.2,REV=2009.08.07-SunOS5.8-all-CSW.pkg.gz
Please verify if it suits your needs.
(0006568)
dam (administrator)
2009-08-13 10:29

Version bumbed to 1.14.3,REV=2009.08.13 and delivered to current/.


Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker