[issue431] wm-ng on grml-medium 0.1

Michael Prokop bts at bts.grml.org
Sat Feb 14 21:49:05 CET 2009


Michael Prokop <mika at grml.org> added the comment:

* Frank Terbeck <bts at bts.grml.org> [20090214 20:29]:

> [snip]
>     #!/bin/bash

> Seems like a plain sh script to me.
> Bash can handle that of course. But it's not needed, AFAICS.

I was afraid due to:

possible bashism in usr_bin/grml-exec-wrapper line 11 (type):
if type -a Xdialog 1>/dev/null 2>&1 && test -n "$DISPLAY" ; then
possible bashism in usr_bin/grml-exec-wrapper line 31 (type):
if type -a "$PROG" 1>/dev/null 2>&1 ; then

=> Is this really a bashism?

>     # use Xdisplay only if present and running under X:
>     display_info() {
>     if type -a Xdialog 1>/dev/null 2>&1 && test -n "$DISPLAY" ; then
>         Xdialog --title "grml-exec-wrapper" --msgbox "$1" 0 0 0
>     else
>         print "$1">&2

> stderr? really?

Yeah, I guess it makes sense as display_info() is invoked in error
situations only.

>     # make sure to support 'grml-exec-wrapper sudo wireshark' as well:
>     case $PROG in
>         *sudo*) PROG="$2" ;;
>     esac

>     if type -a "$PROG" 1>/dev/null 2>&1 ; then
>         exec $@

> Rather:
> exec "$@"

Thanks.

>     else
>         RC=1
>         display_info "Sorry: ${PROG} not available.

>     Looks like the grml flavour you are using does not ship ${PROG}. :(

>     You can search for ${PROG} executing:

>     apt-get update && apt-cache search ${PROG}
>         "
>     fi

> The whole RC variable is unneeded.
> The only way, you end up down here is if you come down from the else
> path above (which is unneeded, for the very same reason.

> Just 'exit 1' should be good enough (and much clearer).

Ah right, good catch. :)

Thanks for reviewing!

regards,
-mika-

----------
assignedto: mika
messages: 1244, 1245, 1876, 1877, 1881
nosy: ft, maddi, mika
priority: bug
status: in-progress
title: wm-ng on grml-medium 0.1
topic: release-stopper

_____________________________________
GRML issue tracker <bts at bts.grml.org>
<http://bts.grml.org/grml/issue431>
_____________________________________


More information about the Bugs-changes mailing list