Bug#530076: emdebian-rootfs: bashism in /bin/sh script

2009-05-25 Thread Neil Williams
On Sat, 23 May 2009 01:19:41 -0500
Raphael Geissert atom...@gmail.com wrote:

possible bashism in ./usr/share/emdebian-tools/update-rc.d line 35
(unsafe echo with backslash):
  echo update-rc.d: $initd/$bn: file does not exist\n
 
  I'm afraid you've been misled. That file is in /usr/share/ because it
  is in storage for placement into the Emdebian Crush root filesystem,
  it is not for use within Debian at all. (If someone really wants to use
  it on their Debian box, that's their own problem, not mine.)
 
 Although it is not the goal of this report, it might be interesting to 
 discuss 
 it in devel and see if there's a more appropriate place for such kind of 
 files.

More likely, dpkg-vendor support will be utilised to make one of the
Emdebian cross-built packages provide the script directly and then it
won't need to be in Debian at all. (Or if it is, it would only exist in
the source package and only be put into a binary package when the
appropriate dpkg-vendor is set.)

   Not using bash (or a Debian Policy conformant shell interpreter which
   doesn't provide such an extra feature) as /bin/sh is likely to lead to
   errors or unexpected behaviours.
 
  Not when the contents root filesystem is dictated by the
  emdebian-rootfs package - there is no release goal for dash in Emdebian.
 
 Dash is the default /bin/sh in Emdebian, right?

No. busybox ash is the default /bin/sh in Emdebian Crush.

Neither dash nor bash are guaranteed to exist in Crush, so
checkbashisms isn't really suitable for our tests.

  I'll probably fix the script later but, for the benefit of the bug
  report, I thought I'd explain why I'm lowering severity and removing
  the usertags. This script has nothing to do with any Debian release
  goals, it's an Emdebian replacement for the Debian release goal script.
 
 Thanks for spending some time to explain it, I appreciate it.

As it turns out, the fix is trivial - just removed the \n and added a
blank echo call.

--- update-rc.d (revision 6327)
+++ update-rc.d (working copy)
@@ -32,7 +32,8 @@
exit 1
 fi
 if [ ! -f $initd/$bn ]; then
-   echo update-rc.d: $initd/$bn: file does not exist\n
+   echo update-rc.d: $initd/$bn: file does not exist
+   echo
exit 1
 fi
 if [ $1 = 'remove' ]; then

No point keeping the bug report around for something like that. I'll
put that fix in.

-- 


Neil Williams
=
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/



pgp8pvPfPeTP8.pgp
Description: PGP signature


Bug#530076: emdebian-rootfs: bashism in /bin/sh script

2009-05-23 Thread Neil Williams
severity 530076 wishlist
thanks

On Sat, 23 May 2009 00:22:49 -0500
Raphael Geissert atom...@gmail.com wrote:

 Package: emdebian-rootfs
 Severity: important
 Version: 2.0.0
 User: debian-rele...@lists.debian.org
 Usertags: goal-dash
 
 Hello maintainer,
 
 While performing an archive wide checkbashisms (from the 'devscripts' package)
 check I've found your package containing a /bin/sh script making use
 of a bashism.
 
 checkbashisms' output:
  possible bashism in ./usr/share/emdebian-tools/update-rc.d line 35 (unsafe
  echo with backslash):
echo update-rc.d: $initd/$bn: file does not exist\n

I'm afraid you've been misled. That file is in /usr/share/ because it
is in storage for placement into the Emdebian Crush root filesystem,
it is not for use within Debian at all. (If someone really wants to use
it on their Debian box, that's their own problem, not mine.)

 Not using bash (or a Debian Policy conformant shell interpreter which doesn't
 provide such an extra feature) as /bin/sh is likely to lead to errors or
 unexpected behaviours.

Not when the contents root filesystem is dictated by the
emdebian-rootfs package - there is no release goal for dash in Emdebian.

 Please be aware that although bash is currently the default /bin/sh there was
 a release goal for Lenny to make dash the default /bin/sh[1], and has been
 proposed for squeeze as well[2].

Doesn't apply to Emdebian root filesystems, we have a different Policy:

http://wiki.debian.org/EmdebianPolicy

The only time that dash matters for emdebian-* is when the script is
expected to run on Debian (to generate files for Emdebian), as with
#530080.

I'll probably fix the script later but, for the benefit of the bug
report, I thought I'd explain why I'm lowering severity and removing
the usertags. This script has nothing to do with any Debian release
goals, it's an Emdebian replacement for the Debian release goal script.

-- 


Neil Williams
=
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/



pgpyJaoI8tJKl.pgp
Description: PGP signature


Bug#530076: emdebian-rootfs: bashism in /bin/sh script

2009-05-23 Thread Raphael Geissert
Hi Neil,

On Saturday 23 May 2009 01:07:35 Neil Williams wrote:
 On Sat, 23 May 2009 00:22:49 -0500
 Raphael Geissert atom...@gmail.com wrote:
[...]
  checkbashisms' output:
   possible bashism in ./usr/share/emdebian-tools/update-rc.d line 35
   (unsafe echo with backslash):
   echo update-rc.d: $initd/$bn: file does not exist\n

 I'm afraid you've been misled. That file is in /usr/share/ because it
 is in storage for placement into the Emdebian Crush root filesystem,
 it is not for use within Debian at all. (If someone really wants to use
 it on their Debian box, that's their own problem, not mine.)

Although it is not the goal of this report, it might be interesting to discuss 
it in devel and see if there's a more appropriate place for such kind of 
files.
The script I wrote to generate the email reports does react to files in 
usr/share/*doc/* by lowering the severity, FTR. If there's some way to 
automagically detect such kind of files I would be able to entirely skip them 
or change the severity as requested.


  Not using bash (or a Debian Policy conformant shell interpreter which
  doesn't provide such an extra feature) as /bin/sh is likely to lead to
  errors or unexpected behaviours.

 Not when the contents root filesystem is dictated by the
 emdebian-rootfs package - there is no release goal for dash in Emdebian.

Dash is the default /bin/sh in Emdebian, right?


  Please be aware that although bash is currently the default /bin/sh there
  was a release goal for Lenny to make dash the default /bin/sh[1], and has
  been proposed for squeeze as well[2].

 Doesn't apply to Emdebian root filesystems, we have a different Policy:

 http://wiki.debian.org/EmdebianPolicy


Just a quick note: you might want to s/POSIX/SUSv3, since only requiring the 
former would make a lot of packages buggy. OTOH your intentions might be 
exactly those.

 The only time that dash matters for emdebian-* is when the script is
 expected to run on Debian (to generate files for Emdebian), as with
 #530080.

 I'll probably fix the script later but, for the benefit of the bug
 report, I thought I'd explain why I'm lowering severity and removing
 the usertags. This script has nothing to do with any Debian release
 goals, it's an Emdebian replacement for the Debian release goal script.

Thanks for spending some time to explain it, I appreciate it.

Cheers,
-- 
Raphael Geissert - Debian Maintainer
www.debian.org - get.debian.net



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org