]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
* Diagnose unsupported architectures earlier and with a clearer error.
authorRuss Allbery <rra@debian.org>
Wed, 10 Aug 2005 21:48:42 +0000 (21:48 +0000)
committerRuss Allbery <rra@debian.org>
Wed, 10 Aug 2005 21:48:42 +0000 (21:48 +0000)
  * Suppress error messages from a missing kernel version header since
    they occur normally when doing the regular package build and are just
    confusing.  Instead, print an error in kern-sysname and abort if the
    kernel version could not be determined.

debian/changelog
debian/kern-sysname
debian/rules
debian/sysname

index f21f44b02149a0da666d2b6258db314675bef1fd..65aff571b1bb64a6fc9f7484763820b7a2716241 100644 (file)
@@ -1,6 +1,11 @@
 openafs (1.3.87-1) unstable; urgency=low
 
   * New upstream version.
+  * Diagnose unsupported architectures earlier and with a clearer error.
+  * Suppress error messages from a missing kernel version header since
+    they occur normally when doing the regular package build and are just
+    confusing.  Instead, print an error in kern-sysname and abort if the
+    kernel version could not be determined.
 
  --
 
index a33cd7237ea10c35e498746c836a95a93bcce7df..429b51c056140dca0dc38680fc4493adaa294382 100644 (file)
@@ -1,80 +1,87 @@
 #!/bin/sh
+
+if [ x"$KVERS" = x ] ; then
+    echo "ERROR: no kernel version" >&2
+    echo "  ($KSRC/include/linux/version.h not found?)" >&2
+    echo UNKNOWN
+    exit 1
+fi
+
 case `arch` in
 i[3456]86)
-       case $KVERS in
-           2.2*)
-               echo i386_linux22
-               ;;
-           2.4*)
-               echo i386_linux24
-               ;;
-           2.6*)
-               echo i386_linux26
-               ;;
-           esac
-;;
+    case $KVERS in
+    2.2*)
+        echo i386_linux22
+        ;;
+    2.4*)
+        echo i386_linux24
+        ;;
+    2.6*)
+        echo i386_linux26
+        ;;
+    esac
+    ;;
 x86_64)
-       case $KVERS in
-           2.4*)
-               echo amd64_linux24
-               ;;
-           2.6*)
-               echo amd64_linux26
-               ;;
-           esac
-;;
-    ia64)
+    case $KVERS in
+    2.4*)
+        echo amd64_linux24
+        ;;
+    2.6*)
+        echo amd64_linux26
+        ;;
+    esac
+    ;;
+ia64)
     echo ia64_linux24
-;;
-    alpha)
-       case $KVERS in
-           2.2*)
-               echo alpha_linux_22
-               ;;
-           2.4*)
-               echo alpha_linux_24
-               ;;
-           esac
-;;
-    sparc)
-       case $KVERS in
-           2.2*)
-               echo sparc_linux22
-               ;;
-           2.4*)
-               echo sparc_linux24
-               ;;
-           esac
-       ;;
-    sparc64)
-        case $KVERS in
-           2.2*)
-               echo sparc64_linux22
-               ;;
-           2.4*)
-               echo sparc64_linux24
-               ;;
-           esac
-       ;;
-           
-    ppc)
-       case $KVERS in
-           2.2*)
-               echo ppc_linux22
-               ;;
-           2.4*)
-               echo ppc_linux24
-               ;;
-           2.6)
-               echo ppc_linux26
-               ;;
-           esac
-           ;;
-    s390)
-        echo s390_linux24
-       ;;
-    *)
-       echo ERROr:  sysname not yet known
-       exit 1
-
+    ;;
+alpha)
+    case $KVERS in
+    2.2*)
+        echo alpha_linux_22
+        ;;
+    2.4*)
+        echo alpha_linux_24
+        ;;
+    esac
+    ;;
+sparc)
+    case $KVERS in
+    2.2*)
+        echo sparc_linux22
+        ;;
+    2.4*)
+        echo sparc_linux24
+        ;;
+    esac
+    ;;
+sparc64)
+    case $KVERS in
+    2.2*)
+        echo sparc64_linux22
+        ;;
+    2.4*)
+        echo sparc64_linux24
+        ;;
+    esac
+    ;;
+ppc)
+    case $KVERS in
+    2.2*)
+        echo ppc_linux22
+        ;;
+    2.4*)
+        echo ppc_linux24
+        ;;
+    2.6)
+        echo ppc_linux26
+        ;;
+    esac
+    ;;
+s390)
+    echo s390_linux24
+    ;;
+*)
+    echo "ERROR: unsupported architecture" >&2
+    echo UNKNOWN
+    exit 1
 esac
index 248207c4139693bafb84e1dd4cfa4e89b74f6672..2875a06ea2a910b67b511c6505b905317e2eb184 100755 (executable)
@@ -21,22 +21,22 @@ else
 endif
 
 # The AFS sysname is determined by a script
-KVERS=`perl -e '$$_ = <>; $$_ =~ m/"(.+)"/; print "$$1\n";' < $(KSRC)/include/linux/version.h`
-SYS_NAME=$(shell KVERS=$(KVERS) sh debian/sysname)
+SYS_NAME := $(shell KVERS=$(KVERS) sh debian/sysname)
 ifndef KSRC
     KSRC = /usr/src/linux
 endif
 ifndef KPKG_DEST_DIR
     KPKG_DEST_DIR = ..
 endif
+KVERS := `perl -e '$$_ = <>; $$_ =~ m/"(.+)"/; print "$$1\n";' $(KSRC)/include/linux/version.h 2> /dev/null`
 export KSRC 
 export KVERS
 export KPKG_DEST_DIR
 
 package   = openafs
 srcpkg    = openafs-modules-source
-modulepkg = $(shell echo openafs-modules-$(KVERS)${INT_SUBARCH})
-moduledir = debian/$(modulepkg)/lib/modules/$(KVERS)/fs
+modulepkg := $(shell echo openafs-modules-$(KVERS)${INT_SUBARCH})
+moduledir := debian/$(modulepkg)/lib/modules/$(KVERS)/fs
 
 LINTIAN_PACKAGES = openafs-dbserver openafs-client openafs-fileserver
 
@@ -60,6 +60,7 @@ get-orig-source:
 
 configure: configure-stamp
 configure-stamp:
+       @if test x"$(SYS_NAME)" = x"UNKNOWN" ; then exit 1 ; fi
        dh_testdir
        -ln -s @sys/dest dest
        -ln -s $(SYS_NAME) @sys
@@ -233,6 +234,7 @@ kdist_clean:
 
 configure-modules: configure-modules-stamp
 configure-modules-stamp:
+       @if test x"$(SYS_NAME)" = x"UNKNOWN" ; then exit 1 ; fi
 ifeq ($(KERNEL_DEPENDS),y)
        sh debian/prep-modules $(KSRC) debian/control.module > debian/control
 else
index bf7bc129af953c8deae02861a21555e554e1afda..86af78a7c1ee2e5f9516c4172b20bdab4874ce81 100755 (executable)
@@ -31,6 +31,7 @@ sparc|sparc64)
     echo sparc_linux24
     ;;
 *)
-    echo ERROr:  sysname not yet known
+    echo "ERROR: unsupported architecture" >&2
+    echo UNKNOWN
     exit 1
 esac