From: Russ Allbery Date: Wed, 10 Aug 2005 21:48:42 +0000 (+0000) Subject: * Diagnose unsupported architectures earlier and with a clearer error. X-Git-Tag: debian/1.3.87-1~19 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=93bb8269b9d211b328521d30932ba200a0455255;p=packages%2Fo%2Fopenafs.git * 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. --- diff --git a/debian/changelog b/debian/changelog index f21f44b02..65aff571b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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. -- diff --git a/debian/kern-sysname b/debian/kern-sysname index a33cd7237..429b51c05 100644 --- a/debian/kern-sysname +++ b/debian/kern-sysname @@ -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 diff --git a/debian/rules b/debian/rules index 248207c41..2875a06ea 100755 --- a/debian/rules +++ b/debian/rules @@ -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 diff --git a/debian/sysname b/debian/sysname index bf7bc129a..86af78a7c 100755 --- a/debian/sysname +++ b/debian/sysname @@ -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