Bug#241395: libc6: preinst fails for kernel 2.4.23dual
At Mon, 12 Apr 2004 20:54:48 +0200, Goswin von Brederlow wrote: However, Jeff already put such code into libc.preinst: if [ $1 != abort-upgrade ] [ `uname -s` = Linux ] then # Test to make sure z 255, in x.y.z-n form of kernel version # Also make sure we don't trip on x.y.zFOO-n form kernel_rev=$(uname -r | tr -- - . | cut -d. -f3 | tr -d [:alpha:]) That will fail with 2.4.25,foo but what the heck. The problem with the code is that its missing a : [EMAIL PROTECTED]:~$ uname -r | tr -- - . | cut -d. -f3 | tr -d [:alpha:] 23dual [EMAIL PROTECTED]:~$ uname -r | tr -- - . | cut -d. -f3 | tr -d [:alpha:] 23 Thanks for your point, I adopt your '[:alpha:]' modification. PS: Please fix that so I can update my kernel (which means I loose the testcase). :) It should be fixed with the next -12 :) Regards, -- gotom -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#241395: libc6: preinst fails for kernel 2.4.23dual
At Mon, 12 Apr 2004 20:54:48 +0200, Goswin von Brederlow wrote: However, Jeff already put such code into libc.preinst: if [ $1 != abort-upgrade ] [ `uname -s` = Linux ] then # Test to make sure z 255, in x.y.z-n form of kernel version # Also make sure we don't trip on x.y.zFOO-n form kernel_rev=$(uname -r | tr -- - . | cut -d. -f3 | tr -d [:alpha:]) That will fail with 2.4.25,foo but what the heck. The problem with the code is that its missing a : [EMAIL PROTECTED]:~$ uname -r | tr -- - . | cut -d. -f3 | tr -d [:alpha:] 23dual [EMAIL PROTECTED]:~$ uname -r | tr -- - . | cut -d. -f3 | tr -d [:alpha:] 23 Thanks for your point, I adopt your '[:alpha:]' modification. PS: Please fix that so I can update my kernel (which means I loose the testcase). :) It should be fixed with the next -12 :) Regards, -- gotom
Bug#241395: libc6: preinst fails for kernel 2.4.23dual
At 03 Apr 2004 00:39:01 +0200, Goswin von Brederlow wrote: There are various ways to fix this situation, one example: kernel_rev=$(uname -r | awk -F '[.-]' '{print $3}' | sed 's/\([[:digit:]]*\).*/\1/' ) kernel_rev=$(uname -r | sed 's/\([0-9]*\.[0-9]*\.\)\([0-9]*\)\(.*\)/\2/') Please don't use awk (see BTS for related bugs). awk requires a Pre-Depends since its an alternative and mawk (provides awk) is not even essential. sed on the other hand is essential. Thanks for your code, but I've put my version. Using awk is no problem. At least it uses in libc.postinst, locales.config. But the reason I've put my version is that it seems more robust for much crazy kernel version for example 2.4.-test1 and so on. Regards, -- gotom -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#241395: libc6: preinst fails for kernel 2.4.23dual
At Mon, 12 Apr 2004 23:28:07 +0900, GOTO Masanori wrote: At 03 Apr 2004 00:39:01 +0200, Goswin von Brederlow wrote: There are various ways to fix this situation, one example: kernel_rev=$(uname -r | awk -F '[.-]' '{print $3}' | sed 's/\([[:digit:]]*\).*/\1/' ) kernel_rev=$(uname -r | sed 's/\([0-9]*\.[0-9]*\.\)\([0-9]*\)\(.*\)/\2/') Please don't use awk (see BTS for related bugs). awk requires a Pre-Depends since its an alternative and mawk (provides awk) is not even essential. sed on the other hand is essential. Thanks for your code, but I've put my version. Using awk is no problem. Ugh, I'm silly that I didn't check Bug#229461. Using awk is problem for some users (Note that AJ and Colin did not think it's problematic. I agreed with them, but in fact mawk is not essential). However, Jeff already put such code into libc.preinst: if [ $1 != abort-upgrade ] [ `uname -s` = Linux ] then # Test to make sure z 255, in x.y.z-n form of kernel version # Also make sure we don't trip on x.y.zFOO-n form kernel_rev=$(uname -r | tr -- - . | cut -d. -f3 | tr -d [:alpha:]) if [ $kernel_rev -ge 255 ] then echo WARNING: Your kernel version indicates a revision number echo of 255 or greater. Glibc has a number of built in echo assumptions that this revision number is less than 255. echo If you\'ve built your own kernel, please make sure that any echo custom version numbers are appended to the upstream echo kernel number with a dash or some other delimiter. exit 1 fi And changelog said: - debian/debhelper.in/libc.preinst: Don't use awk except in upgrade mode. (Closes: #229461) Also make sure that it doesn't trip on words being added to the upstream revision number. Thanks to James Troup for mentioning this. Thanks to Bastian Blank [EMAIL PROTECTED] for the fix. So it seems this #241395 is intentional behavior. But apparently the current code is failed under 2.4.23dual kernel with message: bash: [: : integer expression expected It has to be fixed. I guess many user use 2.4.23dual and so on. So go back to #229461, why should we ignore a version like 2.4.23dual? Jeff, James? I would like to permit 2.4.23dual and recognize as 2.4.23. I'll adopt Goswin's code if no one objects. Regards, -- gotom -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#241395: libc6: preinst fails for kernel 2.4.23dual
GOTO Masanori [EMAIL PROTECTED] writes: At Mon, 12 Apr 2004 23:28:07 +0900, GOTO Masanori wrote: At 03 Apr 2004 00:39:01 +0200, Goswin von Brederlow wrote: There are various ways to fix this situation, one example: kernel_rev=$(uname -r | awk -F '[.-]' '{print $3}' | sed 's/\([[:digit:]]*\).*/\1/' ) kernel_rev=$(uname -r | sed 's/\([0-9]*\.[0-9]*\.\)\([0-9]*\)\(.*\)/\2/') Please don't use awk (see BTS for related bugs). awk requires a Pre-Depends since its an alternative and mawk (provides awk) is not even essential. sed on the other hand is essential. Thanks for your code, but I've put my version. Using awk is no problem. Ugh, I'm silly that I didn't check Bug#229461. Using awk is problem for some users (Note that AJ and Colin did not think it's problematic. I agreed with them, but in fact mawk is not essential). Its not about users but about installing debian (be it real or for a chroot). Using awk is a serious policy violation that just happens to only matter when installing from scratch. I think having the Debian Installer fail is problematic but thats just me. However, Jeff already put such code into libc.preinst: if [ $1 != abort-upgrade ] [ `uname -s` = Linux ] then # Test to make sure z 255, in x.y.z-n form of kernel version # Also make sure we don't trip on x.y.zFOO-n form kernel_rev=$(uname -r | tr -- - . | cut -d. -f3 | tr -d [:alpha:]) That will fail with 2.4.25,foo but what the heck. The problem with the code is that its missing a : [EMAIL PROTECTED]:~$ uname -r | tr -- - . | cut -d. -f3 | tr -d [:alpha:] 23dual [EMAIL PROTECTED]:~$ uname -r | tr -- - . | cut -d. -f3 | tr -d [:alpha:] 23 if [ $kernel_rev -ge 255 ] then echo WARNING: Your kernel version indicates a revision number echo of 255 or greater. Glibc has a number of built in echo assumptions that this revision number is less than 255. echo If you\'ve built your own kernel, please make sure that any echo custom version numbers are appended to the upstream echo kernel number with a dash or some other delimiter. exit 1 fi And changelog said: - debian/debhelper.in/libc.preinst: Don't use awk except in upgrade mode. (Closes: #229461) Also make sure that it doesn't trip on words being added to the upstream revision number. Thanks to James Troup for mentioning this. Thanks to Bastian Blank [EMAIL PROTECTED] for the fix. So it seems this #241395 is intentional behavior. But apparently the current code is failed under 2.4.23dual kernel with message: bash: [: : integer expression expected It has to be fixed. I guess many user use 2.4.23dual and so on. So go back to #229461, why should we ignore a version like 2.4.23dual? Jeff, James? I would like to permit 2.4.23dual and recognize as 2.4.23. I'll adopt Goswin's code if no one objects. Regards, -- gotom MfG Goswin PS: Please fix that so I can update my kernel (which means I loose the testcase). :) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#241395: libc6: preinst fails for kernel 2.4.23dual
At 03 Apr 2004 00:39:01 +0200, Goswin von Brederlow wrote: There are various ways to fix this situation, one example: kernel_rev=$(uname -r | awk -F '[.-]' '{print $3}' | sed 's/\([[:digit:]]*\).*/\1/' ) kernel_rev=$(uname -r | sed 's/\([0-9]*\.[0-9]*\.\)\([0-9]*\)\(.*\)/\2/') Please don't use awk (see BTS for related bugs). awk requires a Pre-Depends since its an alternative and mawk (provides awk) is not even essential. sed on the other hand is essential. Thanks for your code, but I've put my version. Using awk is no problem. At least it uses in libc.postinst, locales.config. But the reason I've put my version is that it seems more robust for much crazy kernel version for example 2.4.-test1 and so on. Regards, -- gotom
Bug#241395: libc6: preinst fails for kernel 2.4.23dual
At Mon, 12 Apr 2004 23:28:07 +0900, GOTO Masanori wrote: At 03 Apr 2004 00:39:01 +0200, Goswin von Brederlow wrote: There are various ways to fix this situation, one example: kernel_rev=$(uname -r | awk -F '[.-]' '{print $3}' | sed 's/\([[:digit:]]*\).*/\1/' ) kernel_rev=$(uname -r | sed 's/\([0-9]*\.[0-9]*\.\)\([0-9]*\)\(.*\)/\2/') Please don't use awk (see BTS for related bugs). awk requires a Pre-Depends since its an alternative and mawk (provides awk) is not even essential. sed on the other hand is essential. Thanks for your code, but I've put my version. Using awk is no problem. Ugh, I'm silly that I didn't check Bug#229461. Using awk is problem for some users (Note that AJ and Colin did not think it's problematic. I agreed with them, but in fact mawk is not essential). However, Jeff already put such code into libc.preinst: if [ $1 != abort-upgrade ] [ `uname -s` = Linux ] then # Test to make sure z 255, in x.y.z-n form of kernel version # Also make sure we don't trip on x.y.zFOO-n form kernel_rev=$(uname -r | tr -- - . | cut -d. -f3 | tr -d [:alpha:]) if [ $kernel_rev -ge 255 ] then echo WARNING: Your kernel version indicates a revision number echo of 255 or greater. Glibc has a number of built in echo assumptions that this revision number is less than 255. echo If you\'ve built your own kernel, please make sure that any echo custom version numbers are appended to the upstream echo kernel number with a dash or some other delimiter. exit 1 fi And changelog said: - debian/debhelper.in/libc.preinst: Don't use awk except in upgrade mode. (Closes: #229461) Also make sure that it doesn't trip on words being added to the upstream revision number. Thanks to James Troup for mentioning this. Thanks to Bastian Blank [EMAIL PROTECTED] for the fix. So it seems this #241395 is intentional behavior. But apparently the current code is failed under 2.4.23dual kernel with message: bash: [: : integer expression expected It has to be fixed. I guess many user use 2.4.23dual and so on. So go back to #229461, why should we ignore a version like 2.4.23dual? Jeff, James? I would like to permit 2.4.23dual and recognize as 2.4.23. I'll adopt Goswin's code if no one objects. Regards, -- gotom
Bug#241395: libc6: preinst fails for kernel 2.4.23dual
GOTO Masanori [EMAIL PROTECTED] writes: At Mon, 12 Apr 2004 23:28:07 +0900, GOTO Masanori wrote: At 03 Apr 2004 00:39:01 +0200, Goswin von Brederlow wrote: There are various ways to fix this situation, one example: kernel_rev=$(uname -r | awk -F '[.-]' '{print $3}' | sed 's/\([[:digit:]]*\).*/\1/' ) kernel_rev=$(uname -r | sed 's/\([0-9]*\.[0-9]*\.\)\([0-9]*\)\(.*\)/\2/') Please don't use awk (see BTS for related bugs). awk requires a Pre-Depends since its an alternative and mawk (provides awk) is not even essential. sed on the other hand is essential. Thanks for your code, but I've put my version. Using awk is no problem. Ugh, I'm silly that I didn't check Bug#229461. Using awk is problem for some users (Note that AJ and Colin did not think it's problematic. I agreed with them, but in fact mawk is not essential). Its not about users but about installing debian (be it real or for a chroot). Using awk is a serious policy violation that just happens to only matter when installing from scratch. I think having the Debian Installer fail is problematic but thats just me. However, Jeff already put such code into libc.preinst: if [ $1 != abort-upgrade ] [ `uname -s` = Linux ] then # Test to make sure z 255, in x.y.z-n form of kernel version # Also make sure we don't trip on x.y.zFOO-n form kernel_rev=$(uname -r | tr -- - . | cut -d. -f3 | tr -d [:alpha:]) That will fail with 2.4.25,foo but what the heck. The problem with the code is that its missing a : [EMAIL PROTECTED]:~$ uname -r | tr -- - . | cut -d. -f3 | tr -d [:alpha:] 23dual [EMAIL PROTECTED]:~$ uname -r | tr -- - . | cut -d. -f3 | tr -d [:alpha:] 23 if [ $kernel_rev -ge 255 ] then echo WARNING: Your kernel version indicates a revision number echo of 255 or greater. Glibc has a number of built in echo assumptions that this revision number is less than 255. echo If you\'ve built your own kernel, please make sure that any echo custom version numbers are appended to the upstream echo kernel number with a dash or some other delimiter. exit 1 fi And changelog said: - debian/debhelper.in/libc.preinst: Don't use awk except in upgrade mode. (Closes: #229461) Also make sure that it doesn't trip on words being added to the upstream revision number. Thanks to James Troup for mentioning this. Thanks to Bastian Blank [EMAIL PROTECTED] for the fix. So it seems this #241395 is intentional behavior. But apparently the current code is failed under 2.4.23dual kernel with message: bash: [: : integer expression expected It has to be fixed. I guess many user use 2.4.23dual and so on. So go back to #229461, why should we ignore a version like 2.4.23dual? Jeff, James? I would like to permit 2.4.23dual and recognize as 2.4.23. I'll adopt Goswin's code if no one objects. Regards, -- gotom MfG Goswin PS: Please fix that so I can update my kernel (which means I loose the testcase). :)
Bug#241395: libc6: preinst fails for kernel 2.4.23dual
GOTO Masanori [EMAIL PROTECTED] writes: At Thu, 01 Apr 2004 07:10:50 +0200, Goswin Brederlow wrote: running cdebootstrap I see the following error: O: /var/lib/dpkg/tmp.ci/preinst: line 184: [: 23dual: integer expression expected ... % uname -r 2.4.23dual You didn't use make-kpkg? I think I did but messed up the append, should have been -dual or something. I have seen no ill effects from this in month so I guess glibc does a scanf and gets 23 as revision number or I'm just plain lucky. Maybe I should have used 2.4.23-dual but I didn't and glibc should cope with that. I guess the 'if [ $kernel_rev -ge 255 ]' should be true in this case too, i.e. display the warning and exit 1, but giving an error on [ is startling (Thats what I mean with cope. Doesn't have to work, just give a helpfull message). There are various ways to fix this situation, one example: kernel_rev=$(uname -r | awk -F '[.-]' '{print $3}' | sed 's/\([[:digit:]]*\).*/\1/' ) kernel_rev=$(uname -r | sed 's/\([0-9]*\.[0-9]*\.\)\([0-9]*\)\(.*\)/\2/') Please don't use awk (see BTS for related bugs). awk requires a Pre-Depends since its an alternative and mawk (provides awk) is not even essential. sed on the other hand is essential. Could someone who is shell script god suggest us the nice way to fix it? Regards, -- gotom Some test versions: sh-2.05b$ echo -e 2.4.23\n2.4.23-1\n2.4.23-foo\n2.4.23foo\n2.4.2342 | sed 's/\([0-9]*\.[0-9]*\.\)\([0-9]*\)\(.*\)/\2/' 23 23 23 23 2342 MfG Goswin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#241395: libc6: preinst fails for kernel 2.4.23dual
Package: libc6 Version: 2.3.2.ds1-11 Severity: important Hi, running cdebootstrap I see the following error: O: /var/lib/dpkg/tmp.ci/preinst: line 184: [: 23dual: integer expression expected Looking at the preinst -- if [ $1 != abort-upgrade ] [ `uname -s` = Linux ] then # Test to make sure z 255, in x.y.z-n form of kernel version kernel_rev=$(uname -r | awk -F '[.-]' '{print $3}') if [ $kernel_rev -ge 255 ] then echo WARNING: Your kernel version indicates a revision number echo of 255 or greater. Glibc has a number of built in echo assumptions that this revision number is less than 255. echo If you\'ve built your own kernel, please make sure that any echo custom version numbers are appended to the upstream echo kernel number with a dash or some other delimiter. exit 1 fi -- the problem becomes clear. % uname -r 2.4.23dual I have seen no ill effects from this in month so I guess glibc does a scanf and gets 23 as revision number or I'm just plain lucky. Maybe I should have used 2.4.23-dual but I didn't and glibc should cope with that. I guess the 'if [ $kernel_rev -ge 255 ]' should be true in this case too, i.e. display the warning and exit 1, but giving an error on [ is startling (Thats what I mean with cope. Doesn't have to work, just give a helpfull message). MfG Goswin -- System Information: Debian Release: testing/unstable Architecture: i386 Kernel: Linux dual 2.4.23dual #1 SMP Sun Dec 14 13:57:16 CET 2003 i686 Locale: LANG=C, LC_CTYPE=de_DE Versions of packages libc6 depends on: ii libdb1-compat 2.1.3-7The Berkeley database routines [gl -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]