[Debian-med-packaging] Bug#535875: libvolpack1-dev: bashism in /bin/sh script

Andreas Tille andreas at an3as.eu
Fri Oct 2 05:38:03 UTC 2009


On Fri, Oct 02, 2009 at 12:19:20AM -0300, Nelson A. de Oliveira wrote:
> On Thu, Oct 1, 2009 at 5:38 PM, Andreas Tille <andreas at an3as.eu> wrote:
> > So what exatly is the bashism in
> >
> > #!/bin/sh -f
> >
> > echo "*** makevolume ***"
> > time makevolume
> > echo "*** rendervolume ***"
> > time rendervolume
> > ...
> 
> Because your "time" is from the time package.
> On systems without the time package installed, we get "dash: time: not found"
> We have time in bash, zsh, etc, but not in dash.

So the fix for this would probably be

if [ -x /usr/bin/time ] ; then
   TIME="time"
else
   TIME=""
fi
echo "*** makevolume ***"
$TIME makevolume
echo "*** rendervolume ***"
$TIME rendervolume
...


If anybody has an idea how to verify that a shell knows a time command I could
extend the chances under which you get the timing output.

Kind regards

    Andreas.

-- 
http://fam-tille.de





More information about the Debian-med-packaging mailing list