Package: oprofile-common
Version: 0.9.2-1
Severity: important
Tags: patch

The /bin/sh script /usr/bin/opcontrol lacks some $ signs in $(( ))
expressions.  Furthermore, I tend to believe that the construct does
not work in plain Bourne shells, meaning that the #!/bin/sh line
should be replaced with #!/bin/bash.  However, I am unsure of that.

Here is the patch:

--- /usr/bin/opcontrol  2006-09-22 07:08:59.000000000 +0300
+++ opcontrol   2006-10-24 15:27:22.425303088 +0300
@@ -316,7 +316,7 @@ do_save_setup()
        >$SETUP_FILE
 
        if test "$NR_CHOSEN" != "0"; then
-               for f in `seq 0 $((NR_CHOSEN - 1))`; do
+               for f in `seq 0 $(($NR_CHOSEN - 1))`; do
                        get_event $f
                        echo "CHOSEN_EVENTS_${f}=$GOTEVENT" >>$SETUP_FILE
                done
@@ -537,7 +537,7 @@ verify_counters()
        OPHELP_ARGS=
 
        if test "$NR_CHOSEN" != 0; then
-               for f in `seq 0 $((NR_CHOSEN - 1))`; do
+               for f in `seq 0 $(($NR_CHOSEN - 1))`; do
                        get_event $f
                        if test "$GOTEVENT" != ""; then
                                OPHELP_ARGS="$OPHELP_ARGS $GOTEVENT"
@@ -559,7 +559,7 @@ normalise_events()
                return
        fi
 
-       for f in `seq 0 $((NR_CHOSEN - 1))`; do
+       for f in `seq 0 $(($NR_CHOSEN - 1))`; do
                get_event $f
                if test "$GOTEVENT" != ""; then
                        EVENT=`echo $GOTEVENT | awk -F: '{print $1}'`
@@ -1106,7 +1106,7 @@ do_param_setup()
        verify_counters
 
        OPROFILED_EVENTS=
-       for f in `seq 0 $((NR_CHOSEN - 1))`; do
+       for f in `seq 0 $(($NR_CHOSEN - 1))`; do
                get_event $f
                if test "$GOTEVENT" != ""; then
                        EVENT=`echo $GOTEVENT | awk -F: '{print $1}'`
@@ -1238,7 +1238,7 @@ do_status()
        fi
 
        if test "$NR_CHOSEN" != "0"; then
-               for f in `seq 0 $((NR_CHOSEN - 1))`; do
+               for f in `seq 0 $(($NR_CHOSEN - 1))`; do
                        get_event $f
                        echo "Event $f: $GOTEVENT"
                done

Best regards,

        Marko
-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.18
Locale: LANG=fi_FI, LC_CTYPE=fi_FI.utf8 (charmap=UTF-8)

Versions of packages oprofile-common depends on:
ii  binutils                     2.17-3      The GNU assembler, linker and bina
ii  debconf [debconf-2.0]        1.5.6       Debian configuration management sy
ii  libc6                        2.3.6.ds1-7 GNU C Library: Shared libraries
ii  libgcc1                      1:4.1.1-17  GCC support library
ii  libpopt0                     1.10-3      lib for parsing cmdline parameters
ii  libstdc++6                   4.1.1-17    The GNU Standard C++ Library v3

oprofile-common recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to