Package: kernel-package
Version: 12.012
Severity: normal
Tags: patch

Hi!

The provided example for header_postinst.d/link is not correct.

a)

The test in line 52 is faulty:

+ '[' '!' -s asm-x86 ']'
+ '[' -e asm ']'
+ '[' /home/oweh -l asm ']'
/etc/kernel/header_postinst.d/link: line 52: [: -l: binary operator expected

The code in this line is

  if [ ~ -l 'asm' ]; then

but I think this should be

  if [ ! -L 'asm' ]; then

because the scripts needs to check if 'asm' is _not_ a symlink, whereas '-l'
tests something not even specified inside the man-page of bash or test (i.e.
I have no idea what '-l' tests)

b)

The test to set the correct architecture is incorrect for i386/amd64, as both
got merged around 2.6.24, thus the check should be "amd64|i386)" instead of just
"amd64)".

I am attaching a patch which fixes both minor problems.

Grüße,
Sven.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.29.1-337 (SMP w/4 CPU cores; PREEMPT)
Locale: lang=de...@euro, lc_ctype=de...@euro (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash

Versions of packages kernel-package depends on:
ii  binutils                      2.19.1-1   The GNU assembler, linker and bina
ii  build-essential               11.4       Informational list of build-essent
ii  debianutils                   3.0.1      Miscellaneous utilities specific t
ii  file                          5.00-1     Determines file type using "magic"
ii  gettext                       0.17-6     GNU Internationalization utilities
ii  make                          3.81-5     The GNU version of the "make" util
ii  module-init-tools             3.7-pre9-1 tools for managing Linux kernel mo
ii  po-debconf                    1.0.16     tool for managing templates file t
ii  util-linux                    2.13.1.1-1 Miscellaneous system utilities

kernel-package recommends no packages.

Versions of packages kernel-package suggests:
ii  bzip2                     1.0.5-1        high-quality block-sorting file co
pn  docbook-utils             <none>         (no description available)
ii  e2fsprogs                 1.41.5-1       ext2/ext3/ext4 file system utiliti
ii  initramfs-tools [linux-in 0.93.2         tools for generating an initramfs
pn  libdb3-dev                <none>         (no description available)
ii  libncurses5-dev [libncurs 5.7+20090411-1 developer's libraries and docs for
ii  linux-source-2.6.29-335 [ skuld.335      Linux kernel source for version 2.
ii  linux-source-2.6.29-336 [ skuld.336      Linux kernel source for version 2.
ii  linux-source-2.6.29.1-337 skuld.337      Linux kernel source for version 2.
ii  linux-source-2.6.29.2-339 skuld.339      Linux kernel source for version 2.
pn  xmlto                     <none>         (no description available)

-- no debconf information
--- /usr/share/kernel-package/examples/etc/kernel/header_postinst.d/link        
2009-04-13 00:18:18.000000000 +0200
+++ /etc/kernel/header_postinst.d/link  2009-05-01 17:26:43.000000000 +0200
@@ -23,7 +23,7 @@
     mipsel)
         architecture='mips'
         ;;
-    amd64)
+    amd64|i386)
         architecture='x86'
         ;;
     *)
@@ -49,7 +49,7 @@
     if [ ! -s "asm-$architecture" ]; then
         echo >&2 "/usr/src/linux-headers-$version/include/asm-$architecture 
does not exist"
     elif [ -e 'asm' ]; then
-        if [ ~ -l 'asm' ]; then
+        if [ ! -L 'asm' ]; then
             echo >&2 "/usr/src/linux-headers-$version/include/asm is not a 
symbolic link"
         else
             rm -f asm

Reply via email to