[Pkg-kde-extras] Bug#489622: kvpnc: bashism in /bin/sh script
Adam D. Barratt wrote: > To get the same behaviour as the original you need > > if [ $fails -gt `expr $TEST_PING_COUNT - 1` ]; then You are quite right, thanks for checking the patch. Regards, -- ,''`. : :' : Chris Lamb `. `'` [EMAIL PROTECTED] `- signature.asc Description: PGP signature ___ pkg-kde-extras mailing list pkg-kde-extras@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/pkg-kde-extras
[Pkg-kde-extras] Bug#489622: kvpnc: bashism in /bin/sh script
On Sun, 2008-08-24 at 14:30 +0100, Chris Lamb wrote: > Patch attached. -if [[ $fails > `expr $TEST_PING_COUNT - 1` ]]; then +if [ $fails > `expr $TEST_PING_COUNT - 1` ]; then Unfortunately the fix there is slightly broken - it creates a file with a numeric filename rather than comparing the two numbers; yay for the extensions in [[. :-/ To get the same behaviour as the original you need if [ $fails -gt `expr $TEST_PING_COUNT - 1` ]; then Regards, Adam ___ pkg-kde-extras mailing list pkg-kde-extras@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/pkg-kde-extras
[Pkg-kde-extras] Bug#489622: kvpnc: bashism in /bin/sh script
tags 489622 + patch thanks Patch attached. Regards, -- Chris Lamb, UK [EMAIL PROTECTED] GPG: 0x634F9A20 diff -urNd kvpnc-0.9.0.orig/src/ping_check.sh kvpnc-0.9.0/src/ping_check.sh --- kvpnc-0.9.0.orig/src/ping_check.sh 2008-08-24 14:28:03.0 +0100 +++ kvpnc-0.9.0/src/ping_check.sh 2008-08-24 14:28:46.0 +0100 @@ -61,7 +61,7 @@ if [ $QUIET -eq '1' ]; then echo -n "Ping sequence "$count": " fi -if [[ -z `ping -c 1 -w 5 $PINGHOST 2>&1 | grep '1 received'` ]]; then +if [ -z `ping -c 1 -w 5 $PINGHOST 2>&1 | grep '1 received'` ]; then fails=`expr $fails + 1` if [ $QUIET -eq '1' ]; then echo "failed!" @@ -78,7 +78,7 @@ if [ $QUIET -eq '1' ]; then echo -n "PING failitures: "$fails" => " fi -if [[ $fails > `expr $TEST_PING_COUNT - 1` ]]; then +if [ $fails > `expr $TEST_PING_COUNT - 1` ]; then echo "PING failed!" else signature.asc Description: PGP signature ___ pkg-kde-extras mailing list pkg-kde-extras@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/pkg-kde-extras
[Pkg-kde-extras] Bug#489622: kvpnc: bashism in /bin/sh script
Package: kvpnc Severity: important Version: 0.9.0-1 User: [EMAIL PROTECTED] Usertags: goal-dash Hello maintainer, While performing an archive wide checkbashisms (from the 'devscripts' package) check I've found your package containing one or more /bin/sh scripts making use of bashisms. checkbashisms' output: > possible bashism in ./usr/share/apps/kvpnc/ping_check.sh line 64 > (alternative test command ([[ foo ]] should be [ foo ])): > if [[ -z `ping -c 1 -w 5 $PINGHOST 2>&1 | grep '1 received'` ]]; then > possible bashism in > ./usr/share/apps/kvpnc/ping_check.sh line 81 (alternative test command ([[ > foo ]] should be [ foo ])): > if [[ $fails > `expr $TEST_PING_COUNT - 1` ]]; then Not using bash (or a Debian Policy conformant shell interpreter which does provide such an extra feature) as /bin/sh is likely to lead to errors or unexpected behaviours. Please be aware that although bash is currently the default /bin/sh there's a release goal for Lenny to make dash the default /bin/sh[1]. If you want more information about dash as /bin/sh, you can read: http://lists.debian.org/debian-release/2008/01/msg00189.html For more information please refer to the Debian Policy section 10.4 supporting this argument at: http://www.debian.org/doc/debian-policy/ch-files.html#s-scripts Hints about how to fix bashisms: Sometimes these bugs are already fixed in Ubuntu, look at the PTS. If not already fixed you can read: https://wiki.ubuntu.com/DashAsBinSh [1]http://release.debian.org/lenny/goals.txt Thank you, -- Atomo64 - Raphael Please avoid sending me Word, PowerPoint or Excel attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ___ pkg-kde-extras mailing list pkg-kde-extras@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/pkg-kde-extras