Bug#374185: mkvmlinuz: syntax errors in script
On Wed, Jul 26, 2006 at 10:09:26PM +0100, Colin Watson wrote: On Wed, Jul 12, 2006 at 10:42:38PM +0200, Bastian Blank wrote: reopen 374185 unreproducible severity 374185 important thanks On Wed, Jul 12, 2006 at 09:50:53AM +0100, Colin Watson wrote: This part of the report is still valid no matter whether you're using dash or bash. In bash, I get: /usr/sbin/mkvmlinuz: 61: arith: syntax error: OPTIND-1 | $ cat test.sh | shift $((OPTIND-1)) | $ bash -x test.sh | + shift 0 Oh, I do apologise, it turned out that my /bin/sh was dash after all so I got confused. Using non-$-prefixed variables inside arithmetic expansion was a bit of shell syntax [1] that I wasn't aware of. Sven: it was OPTIND = $OPTIND I was talking about, not the added spaces. It doesn't seem unreasonable to change mkvmlinuz to work around this dash bug (linked to by Gerrit) for now, though. Personally (and I suppose it's a matter of taste) I find it clearer to $-prefix variables even inside arithmetic expansions. [1] http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_04 Ok , i will have a look next week (err, the august 7 one). Feel free to commit the (tested) fix to svn in the meantime. Friendly, Svne Luther -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#374185: mkvmlinuz: syntax errors in script
On Wed, Jul 12, 2006 at 10:42:38PM +0200, Bastian Blank wrote: reopen 374185 unreproducible severity 374185 important thanks On Wed, Jul 12, 2006 at 09:50:53AM +0100, Colin Watson wrote: This part of the report is still valid no matter whether you're using dash or bash. In bash, I get: /usr/sbin/mkvmlinuz: 61: arith: syntax error: OPTIND-1 | $ cat test.sh | shift $((OPTIND-1)) | $ bash -x test.sh | + shift 0 Oh, I do apologise, it turned out that my /bin/sh was dash after all so I got confused. Using non-$-prefixed variables inside arithmetic expansion was a bit of shell syntax [1] that I wasn't aware of. Sven: it was OPTIND = $OPTIND I was talking about, not the added spaces. It doesn't seem unreasonable to change mkvmlinuz to work around this dash bug (linked to by Gerrit) for now, though. Personally (and I suppose it's a matter of taste) I find it clearer to $-prefix variables even inside arithmetic expansions. [1] http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_04 Cheers, -- Colin Watson [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#374185: mkvmlinuz: syntax errors in script
On Wed, Jul 12, 2006 at 10:43:33PM +0200, Bastian Blank wrote: On Wed, Jul 12, 2006 at 01:30:13PM +0200, Sven Luther wrote: That said, it is indeed logical to add spaces, and if so i don't understand why it didn't work previously. | shift $(($OPTIND-1)) Maybe more correct. Yes, but dash should actually support $((OPTIND-1)) also, see http://bugs.debian.org/329025 Regards, Gerrit. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#374185: mkvmlinuz: syntax errors in script
reopen 374185 thanks On Sat, Jun 17, 2006 at 08:15:29PM +0200, Wouter Verhelst wrote: --- mkvmlinuz.orig2006-06-17 20:03:05.0 +0200 +++ /usr/sbin/mkvmlinuz 2006-06-17 20:13:40.0 +0200 @@ -60,7 +60,7 @@ esac # use non-option arguments as release version and kernel image file if needed -shift $((OPTIND-1)) +shift $(( $OPTIND - 1 )) if test -z $release -a -n $1; then release=$1 fi This part of the report is still valid no matter whether you're using dash or bash. In bash, I get: /usr/sbin/mkvmlinuz: 61: arith: syntax error: OPTIND-1 Please apply this part of Wouter's patch. Thanks, -- Colin Watson [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#374185: mkvmlinuz: syntax errors in script
On Wed, Jul 12, 2006 at 09:50:53AM +0100, Colin Watson wrote: reopen 374185 thanks On Sat, Jun 17, 2006 at 08:15:29PM +0200, Wouter Verhelst wrote: --- mkvmlinuz.orig 2006-06-17 20:03:05.0 +0200 +++ /usr/sbin/mkvmlinuz 2006-06-17 20:13:40.0 +0200 @@ -60,7 +60,7 @@ esac # use non-option arguments as release version and kernel image file if needed -shift $((OPTIND-1)) +shift $(( $OPTIND - 1 )) if test -z $release -a -n $1; then release=$1 fi This part of the report is still valid no matter whether you're using dash or bash. In bash, I get: /usr/sbin/mkvmlinuz: 61: arith: syntax error: OPTIND-1 Please apply this part of Wouter's patch. If you explain to me why i never saw this problem myself though. That said, it is indeed logical to add spaces, and if so i don't understand why it didn't work previously. Friendly, Sven Luther -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#374185: mkvmlinuz: syntax errors in script
reopen 374185 unreproducible severity 374185 important thanks On Wed, Jul 12, 2006 at 09:50:53AM +0100, Colin Watson wrote: This part of the report is still valid no matter whether you're using dash or bash. In bash, I get: /usr/sbin/mkvmlinuz: 61: arith: syntax error: OPTIND-1 | $ cat test.sh | shift $((OPTIND-1)) | $ bash -x test.sh | + shift 0 Bastian -- A princess should not be afraid -- not with a brave knight to protect her. -- McCoy, Shore Leave, stardate 3025.3 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#374185: mkvmlinuz: syntax errors in script
On Wed, Jul 12, 2006 at 01:30:13PM +0200, Sven Luther wrote: That said, it is indeed logical to add spaces, and if so i don't understand why it didn't work previously. | shift $(($OPTIND-1)) Maybe more correct. Bastian -- Each kiss is as the first. -- Miramanee, Kirk's wife, The Paradise Syndrome, stardate 4842.6
Bug#374185: mkvmlinuz: syntax errors in script
On Sun, Jun 18, 2006 at 03:04:06AM +0200, Sven Luther wrote: On Sat, Jun 17, 2006 at 08:15:29PM +0200, Wouter Verhelst wrote: Package: mkvmlinuz Version: 22 Severity: grave Justification: make package in question unusable Hi, mkvmlinuz currently fails to work at all. There are a number of syntax errors in the script, which would need to be fixed before it can ever hope to run successfully. Did whoever uploaded this actually test it before uploading? I did, and it works fine, i am using it. Can you give more details about the environment of your failure ? What machine, arch, subarch, distribution, and probably stuff like your default shell, are involved. My default shell is dash. I had forgotten about that, thought it was bash, which would make this extremely bad code. Since it wasn't, the bug is still important (as Bastian changed it to), but certainly not grave. Sorry for that mistake. -- Fun will now commence -- Seven Of Nine, Ashes to Ashes, stardate 53679.4 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#374185: mkvmlinuz: syntax errors in script
Package: mkvmlinuz Version: 22 Severity: grave Justification: make package in question unusable Hi, mkvmlinuz currently fails to work at all. There are a number of syntax errors in the script, which would need to be fixed before it can ever hope to run successfully. Did whoever uploaded this actually test it before uploading? Anyway. Patch follows: --- mkvmlinuz.orig 2006-06-17 20:03:05.0 +0200 +++ /usr/sbin/mkvmlinuz 2006-06-17 20:13:40.0 +0200 @@ -60,7 +60,7 @@ esac # use non-option arguments as release version and kernel image file if needed -shift $((OPTIND-1)) +shift $(( $OPTIND - 1 )) if test -z $release -a -n $1; then release=$1 fi @@ -115,7 +115,8 @@ if test -z $noinitrd -a -z $initrd; then # guess the location of an initrd, but don't try too hard -if initrd=${kernel/vmlinux/initrd.img}; test -r $initrd; then +initrd=$(echo $kernel | sed -e 's/vmlinux/initrd.img/') +if test -r $initrd; then : else initrd= -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing') Architecture: powerpc (ppc) Shell: /bin/sh linked to /bin/dash Kernel: Linux 2.6.16-2-powerpc Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=UTF-8) Versions of packages mkvmlinuz depends on: ii binutils 2.16.1cvs20060413-1 The GNU assembler, linker and bina ii debconf [debconf-2.0 1.5.2 Debian configuration management sy mkvmlinuz recommends no packages. -- debconf information excluded -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#374185: mkvmlinuz: syntax errors in script
severity 374185 important tags 374185 moreinfo On Sat, Jun 17, 2006 at 08:15:29PM +0200, Wouter Verhelst wrote: mkvmlinuz currently fails to work at all. There are a number of syntax errors in the script, which would need to be fixed before it can ever hope to run successfully. Did whoever uploaded this actually test it before uploading? None if the patched parts shows syntax errors if used with bash. Bastian -- Where there's no emotion, there's no motive for violence. -- Spock, Dagger of the Mind, stardate 2715.1 signature.asc Description: Digital signature
Bug#374185: mkvmlinuz: syntax errors in script
On Sat, Jun 17, 2006 at 08:38:42PM +0200, Bastian Blank wrote: severity 374185 important tags 374185 moreinfo What type of info do you need? On Sat, Jun 17, 2006 at 08:15:29PM +0200, Wouter Verhelst wrote: mkvmlinuz currently fails to work at all. There are a number of syntax errors in the script, which would need to be fixed before it can ever hope to run successfully. Did whoever uploaded this actually test it before uploading? None if the patched parts shows syntax errors if used with bash. Ah, yes, whoops. I forgot; I have /bin/sh pointing to dash. My mistake, sorry. -- Fun will now commence -- Seven Of Nine, Ashes to Ashes, stardate 53679.4 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#374185: mkvmlinuz: syntax errors in script
On Sat, Jun 17, 2006 at 08:15:29PM +0200, Wouter Verhelst wrote: Package: mkvmlinuz Version: 22 Severity: grave Justification: make package in question unusable Hi, mkvmlinuz currently fails to work at all. There are a number of syntax errors in the script, which would need to be fixed before it can ever hope to run successfully. Did whoever uploaded this actually test it before uploading? I did, and it works fine, i am using it. Can you give more details about the environment of your failure ? What machine, arch, subarch, distribution, and probably stuff like your default shell, are involved. Anyway, the code in question was written by Jens Schmalzing, i believe, certainly not by me, but your patch seems indeed harmless and reasonable, and i will apply it for version 23. Friendly, Sven Luther -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]