Bah, my patch had a couple of typos, please use this one instead.

-- 
Loïc Minier <[EMAIL PROTECTED]>
--- /usr/share/kernel-package/ruleset/misc/version_vars.mk.orig2        
2006-09-29 22:10:32.000000000 +0200
+++ /usr/share/kernel-package/ruleset/misc/version_vars.mk      2006-09-29 
23:56:44.000000000 +0200
@@ -34,6 +34,8 @@
 ##
 ###############################################################################
 
+# macro outputing $(1) if KPKG_DEBUG is set, and resolving it in all cases
+doit = $(if $(KPKG_DEBUG),$(warning DEBUG: $(1)))$(shell $(1))
 
 ifeq ($(DEB_HOST_GNU_SYSTEM), linux-gnu)
   localversion_files := $(wildcard localversion*)
@@ -53,40 +55,40 @@
   # Could have used :=, but some patches do seem to patch the
   # Makefile. perhaps deferring the rule makes that better
   $(eval $(which_debdir))
-  VERSION      :=$(shell $(MAKE) $(CROSS_ARG) ARCH=$(KERNEL_ARCH) 
--no-print-directory -sf            \
+  VERSION      := $(call doit,$(MAKE) $(CROSS_ARG) ARCH=$(KERNEL_ARCH) 
--no-print-directory -sf            \
                          $(DEBDIR)/ruleset/kernel_version.mk debian_VERSION)
-  PATCHLEVEL   :=$(shell $(MAKE) $(CROSS_ARG) ARCH=$(KERNEL_ARCH) 
--no-print-directory -sf            \
+  PATCHLEVEL   := $(call doit,$(MAKE) $(CROSS_ARG) ARCH=$(KERNEL_ARCH) 
--no-print-directory -sf            \
                          $(DEBDIR)/ruleset/kernel_version.mk debian_PATCHLEVEL)
-  SUBLEVEL     :=$(shell $(MAKE) $(CROSS_ARG) ARCH=$(KERNEL_ARCH) 
--no-print-directory -sf            \
+  SUBLEVEL     := $(call doit,$(MAKE) $(CROSS_ARG) ARCH=$(KERNEL_ARCH) 
--no-print-directory -sf            \
                          $(DEBDIR)/ruleset/kernel_version.mk debian_SUBLEVEL)
-  EXTRA_VERSION:=$(shell $(MAKE) $(CROSS_ARG) ARCH=$(KERNEL_ARCH) 
--no-print-directory -sf            \
+  EXTRA_VERSION:= $(call doit,$(MAKE) $(CROSS_ARG) ARCH=$(KERNEL_ARCH) 
--no-print-directory -sf            \
                          $(DEBDIR)/ruleset/kernel_version.mk 
debian_EXTRAVERSION)
-  LOCALVERSION :=$(shell $(MAKE) $(CROSS_ARG) ARCH=$(KERNEL_ARCH) 
--no-print-directory -sf            \
+  LOCALVERSION := $(call doit,$(MAKE) $(CROSS_ARG) ARCH=$(KERNEL_ARCH) 
--no-print-directory -sf            \
                          $(DEBDIR)/ruleset/kernel_version.mk 
debian_LOCALVERSION)
 else
   ifeq ($(DEB_HOST_GNU_SYSTEM), kfreebsd-gnu)
-    VERSION        =$(shell grep '^REVISION=' conf/newvers.sh |                
   \
+    VERSION        = $(call doit,grep '^REVISION=' conf/newvers.sh |           
        \
       sed -e 's/[^0-9]*\([0-9]\)\..*/\1/')
-    PATCHLEVEL =$(shell grep '^REVISION=' conf/newvers.sh |                    
   \
+    PATCHLEVEL = $(call doit,grep '^REVISION=' conf/newvers.sh |               
        \
      sed -e 's/[^0-9]*[0-9]*\.\([0-9]*\)[^0-9]*/\1/')
     SUBLEVEL =0
-    EXTRA_VERSION =$(shell grep '^RELEASE=' conf/newvers.sh |                  
   \
+    EXTRA_VERSION = $(call doit,grep '^RELEASE=' conf/newvers.sh |             
        \
      sed -e 's/[^0-9]*\([0-9]*\)[^0-9]*/\1/')
     LOCALVERSION = $(subst $(space),,                                          
   \
-       $(shell cat /dev/null $(localversion_files)) $(CONFIG_LOCALVERSION))
+       $(call doit,cat /dev/null $(localversion_files)) $(CONFIG_LOCALVERSION))
   endif
 endif
 
-KERNELRELEASE = $(shell if [ -f .kernelrelease ]; then          \
+KERNELRELEASE = $(call doit,if [ -f .kernelrelease ]; then          \
                            cat .kernelrelease 2> /dev/null ;    \
                         else                                    \
                           echo "";                              \
                        fi;)  
 
-HAVE_NEW_MODLIB =$(shell grep -E '\(INSTALL_MOD_PATH\)' Makefile 2>/dev/null )
+HAVE_NEW_MODLIB = $(call doit, grep -E '\(INSTALL_MOD_PATH\)' Makefile 
2>/dev/null)
 
 ifneq ($(strip $(EXTRA_VERSION)),)
-HAS_ILLEGAL_EXTRA_VERSION =$(shell                                             
     \
+HAS_ILLEGAL_EXTRA_VERSION = $(call doit,                                       
      \
     perl -e '$$i="$(EXTRA_VERSION)"; $$i !~ m/^[a-z\.\-\+][a-z\d\.\-\+]*$$/o 
&& print YES;')
   ifneq ($(strip $(HAS_ILLEGAL_EXTRA_VERSION)),)
     $(error Error: The EXTRAVERSION may only contain lowercase alphanumerics   
     \
@@ -94,7 +96,7 @@
   endif
 endif
 
-EXTRAVERSION =$(strip $(EXTRA_VERSION))
+EXTRAVERSION = $(strip $(EXTRA_VERSION))
 ifneq ($(strip $(APPEND_TO_VERSION)),)
 iatv := $(strip $(APPEND_TO_VERSION))
 EXTRAV_ARG := EXTRAVERSION=${EXTRA_VERSION}${iatv}
@@ -103,12 +105,12 @@
 EXTRAV_ARG :=
 endif
 
-UTS_RELEASE_HEADER=$(shell if [ -f include/linux/utsrelease.h ]; then \
+UTS_RELEASE_HEADER = $(call doit,if [ -f include/linux/utsrelease.h ]; then \
                               echo include/linux/utsrelease.h;       \
                           else                                       \
                                echo include/linux/version.h ; \
                           fi)
-UTS_RELEASE_VERSION=$(shell if [ -f $(UTS_RELEASE_HEADER) ]; then              
          \
+UTS_RELEASE_VERSION = $(call doit,if [ -f $(UTS_RELEASE_HEADER) ]; then        
                \
                  grep 'define UTS_RELEASE' $(UTS_RELEASE_HEADER) |             
          \
                  perl -nle  'm/^\s*\#define\s+UTS_RELEASE\s+("?)(\S+)\1/g && 
print $$2;';\
                  else echo "" ;                                                
          \
@@ -117,7 +119,7 @@
 version = 
$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(iatv)$(LOCALVERSION)
 
 # Bug out if the version number id not all lowercase
-lc_version = $(shell echo $(version) | tr A-Z a-z)
+lc_version = $(call doit,echo $(version) | tr A-Z a-z)
 ifneq ($(strip $(version)),$(strip $(lc_version)))
   ifeq ($(strip $(IGNORE_UPPERCASE_VERSION)),)
     $(error Error. The version number $(strip $(version)) is not all \
@@ -135,12 +137,12 @@
 endif
 
 
-AM_OFFICIAL := $(shell if [ -f debian/official ]; then echo YES; fi )
+AM_OFFICIAL := $(call doit, if [ -f debian/official ]; then echo YES; fi )
 
 # See if we are being run in the kernel directory
 ifeq ($(DEB_HOST_GNU_SYSTEM), linux-gnu)
   define check_kernel_dir
-  IN_KERNEL_DIR := $(shell if test -d drivers && test -d kernel && test -d fs 
&& test \
+  IN_KERNEL_DIR := $(call doit,if test -d drivers && test -d kernel && test -d 
fs && test \
                                    -d include/linux ; then                     
       \
                                       echo YES;                                
       \
                            fi )
@@ -148,14 +150,14 @@
 else
   ifeq ($(DEB_HOST_GNU_SYSTEM), kfreebsd-gnu)
     define check_kernel_dir
-    IN_KERNEL_DIR := $(shell if test -d dev && test -d kern && test -d fs &&   
       \
+    IN_KERNEL_DIR := $(call doit,if test -d dev && test -d kern && test -d fs 
&&          \
                              test -d i386/include ; then echo YES; fi)
     endef
   endif
 endif
 
 define check_kernel_headers
-IN_KERNEL_HEADERS=$(shell if [ -f $(INT_STEM)-headers.revision ]; then         
       \
+IN_KERNEL_HEADERS=$(call doit,if [ -f $(INT_STEM)-headers.revision ]; then     
           \
                                cat $(INT_STEM)-headers.revision;               
       \
                             else echo "" ;                                     
       \
                             fi)

Reply via email to