Package: devscripts
Version: 2.10.33
Severity: normal
Tags: checkbashisms, patch

Hi!

I was wondering why one of my scripts didn't work with /bin/sh -> dash,
while checkbashisms didn't complain:

=====
[EMAIL PROTECTED]:~$ volume-amixer.sh up
/usr/local/bin/volume-amixer.sh: 27: function: not found

/usr/local/bin/volume-amixer.sh: 32: Syntax error: "}" unexpected

[EMAIL PROTECTED]:~$ checkbashisms -n -f -x `which volume-amixer.sh`
possible bashism in /usr/local/bin/volume-amixer.sh line 43 (echo -n):
echo -n "$CONTROL_NAME volume "
possible bashism in /usr/local/bin/volume-amixer.sh line 49 (echo -n):
            echo -n "unmute, "
possible bashism in /usr/local/bin/volume-amixer.sh line 62 (echo -n):
        echo -n "up, "
possible bashism in /usr/local/bin/volume-amixer.sh line 70 (echo -n):
        echo -n "down, "
possible bashism in /usr/local/bin/volume-amixer.sh line 74 (echo -e):
        echo -e "Usage: $0 {mute|up|down}"
[EMAIL PROTECTED]:~$
=====

The problem is the same as bug #324599 [1], whose fix was reverted with
r1434.  Since that commit was done to get in sync with lintian, lintian
is fault there too [3].

The patch is trivial:

--8<---------------cut here---------------start------------->8---
--- checkbashisms.~1~   2008-07-09 17:30:11.000000000 +0200
+++ checkbashisms       2008-07-10 22:01:35.000000000 +0200
@@ -412,7 +412,7 @@
 sub init_hashes {
     my $LEADIN = qr'(?:(^|[`&;(|{])\s*|(if|do|while)\s+)';
     %bashisms = (
-       qr'(?:^|\s+)function \w+\(\s*\)' =>   q<'function' is useless>,
+       qr'(?:^|\s+)function \w+\s*' =>   q<'function' is useless>,
        $LEADIN . qr'select\s+\w+' =>     q<'select' is not POSIX>,
        $LEADIN . qr'source\s+(?:\.\/|\/|\$)[^\s]+' =>
                                       q<should be '.', not 'source'>,
--8<---------------cut here---------------end--------------->8---

Now I can fix the other bashisms in my script ;-)

Thx, bye,
Gismo / Luca

Footnotes: 
[1] http://bugs.debian.org/324599
[2] 
http://svn.debian.org/viewsvn/devscripts/trunk/scripts/checkbashisms.pl?rev=1434&r1=1427&r2=1434
[3] I'd duplicate this bug as soon as the bug will be assigned a number

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-rc9-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages devscripts depends on:
ii  dpkg-dev                      1.14.20    Debian package development tools
ii  libc6                         2.7-12     GNU C Library: Shared libraries
ii  perl                          5.10.0-11  Larry Wall's Practical Extraction 

Versions of packages devscripts recommends:
ii  at                 3.1.10.1              Delayed job execution and batch pr
ii  bsd-mailx [mailx]  8.1.2-0.20071201cvs-3 A simple mail user agent
ii  conkeror [www-brow 0.9~git080522-2       keyboard focused web browser with 
ii  curl               7.18.2-5              Get a file from an HTTP, HTTPS or 
ii  cvs                1:1.12.13-11          Concurrent Versions System
ii  dctrl-tools        2.13.0                Command-line tools to process Debi
ii  debian-keyring     2008.05.28            GnuPG (and obsolete PGP) keys of D
ii  debian-maintainers 1.39                  GPG keys of Debian maintainers
ii  dput               0.9.2.32              Debian package upload tool
pn  equivs             <none>                (no description available)
ii  fakeroot           1.9.5                 Gives a fake root environment
ii  git-core           1:1.5.6.2-1           fast, scalable, distributed revisi
ii  gnupg              1.4.9-2               GNU privacy guard - a free PGP rep
ii  iceweasel [www-bro 3.0~rc2-2             lightweight web browser based on M
pn  libauthen-sasl-per <none>                (no description available)
pn  libcrypt-ssleay-pe <none>                (no description available)
pn  libparse-debcontro <none>                (no description available)
pn  libsoap-lite-perl  <none>                (no description available)
pn  libterm-size-perl  <none>                (no description available)
ii  libtimedate-perl   1.1600-9              Time and date functions for Perl
ii  liburi-perl        1.35.dfsg.1-1         Manipulates and accesses URI strin
pn  libwww-perl        <none>                (no description available)
pn  libyaml-syck-perl  <none>                (no description available)
ii  lintian            1.24.1                Debian package checker
ii  lsb-release        3.2-13                Linux Standard Base version report
ii  man-db             2.5.2-1               on-line manual pager
ii  openssh-client [ss 1:4.7p1-12            secure shell client, an rlogin/rsh
ii  patch              2.5.9-5               Apply a diff file to an original
pn  patchutils         <none>                (no description available)
ii  strace             4.5.15-1.2            A system call tracer
ii  subversion         1.4.6dfsg1-4          Advanced version control system
ii  unzip              5.52-11               De-archiver for .zip files
ii  w3m [www-browser]  0.5.2-2+b1            WWW browsable pager with excellent
ii  wdiff              0.5-18                Compares two files word by word
ii  wget               1.11.4-1              retrieves files from the web

-- no debconf information

Attachment: pgp6qTxBmdJcP.pgp
Description: PGP signature

Reply via email to