Package: kernel-package
Version: 11.001
Followup-For: Bug #423721

Hey,

I've been looking a bit more into this stuff and found that -dirty is
not always correcty set. In particular, if the git source tree is still
clean when make-kpkg is first run, the debian target will not have
-dirty in the package name. Later on, at the stamp-config fixes some
"idocy" by removing scripts/package/builddeb and
scripts/package/Makefile, which makes the git checkout dirty.

So, by the time that utsrelease.h is generated, the checkout is dirty. I
think this is exactly what the GIT_VERSION variable is supposed to fix,
but it contains the full local version, with an extra -dirty appended.

I've attached a patch that should work around this by doing the
builddeb/Makefile fix before creating the debian/ dir, so the git
checkout will be dirty from the very beginning. I think this is the most
reliable way to handle this, if we really need to make the checkout
dirty.

It would, of course, be very much preferable if kernel-package did not
touch any of the git-controlled files, so the checkout would remain
clean (which gives the -dirty suffix a bit more meaning). I'm not sure
what those files do or why they are a problem, but couldn't that be
solved without modifying them? (I've checked that, after a full
kernel_image, those two files are the only changes that make the
checkout dirty).

Gr.

Matthijs

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.22-rc6-ga5b67c9e-dirty (PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages kernel-package depends on:
ii  dpkg                          1.14.5     package maintenance system for Deb
ii  dpkg-dev                      1.14.5     package building tools for Debian
ii  file                          4.21-1     Determines file type using "magic"
ii  gcc [c-compiler]              4:4.1.2-3  The GNU C compiler
ii  gcc-4.1 [c-compiler]          4.1.2-12   The GNU C compiler
ii  gettext                       0.16.1-2   GNU Internationalization utilities
ii  make                          3.81-3     The GNU version of the "make" util
ii  perl                          5.8.8-7    Larry Wall's Practical Extraction 
ii  po-debconf                    1.0.9      manage translated Debconf template

Versions of packages kernel-package recommends:
ii  bzip2                         1.0.3-7    high-quality block-sorting file co
ii  libc6-dev [libc-dev]          2.5-11     GNU C Library: Development Librari

-- no debconf information
diff -ur ruleset.orig/minimal.mk ruleset/minimal.mk
--- ruleset.orig/minimal.mk     2007-07-15 18:53:21.000000000 +0200
+++ ruleset/minimal.mk  2007-07-15 18:38:16.000000000 +0200
@@ -89,6 +89,12 @@
 minimal_debian:
        $(REASON)
        @echo "This is kernel package version $(kpkg_version)."
+       # work around idiocy in recent kernel versions
+       test ! -e scripts/package/builddeb || \
+            mv -f scripts/package/builddeb scripts/package/builddeb.kpkg-dist
+       test ! -e scripts/package/Makefile || \
+            (mv -f scripts/package/Makefile scripts/package/Makefile.kpkg-dist 
&& \
+               (echo "# Dummy file "; echo "help:") >  
scripts/package/Makefile)
        test -d debian || mkdir debian
        test ! -e stamp-building || rm -f stamp-building
        test -f debian/control || sed         -e 's/=V/$(version)/g'        \
diff -ur ruleset.orig/misc/version_vars.mk ruleset/misc/version_vars.mk
--- ruleset.orig/misc/version_vars.mk   2007-07-15 18:53:05.000000000 +0200
+++ ruleset/misc/version_vars.mk        2007-07-15 18:39:03.000000000 +0200
@@ -95,12 +95,6 @@
   ifneq (,$(strip $(HAVE_BAD_VERSION)))
     $(error Error: "$(VERSION)")
   endif
-  ifneq ($(strip $(CONFIG_LOCALVERSION_AUTO)),)
-    GIT_VERSION=$(shell /bin/sh scripts/setlocalversion)
-    ifneq ($(strip $(GIT_VERSION)),)
-      GIT_VERSION:=$(GIT_VERSION)-dirty
-    endif
-  endif
 else
   ifeq ($(DEB_HOST_GNU_SYSTEM), kfreebsd-gnu)
     VERSION        =$(call doit,grep '^REVISION=' conf/newvers.sh |            
       \
@@ -152,7 +146,7 @@
                  else echo "" ;                                                
          \
                  fi)
 
-version = 
$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(iatv)$(LOCALVERSION)$(GIT_VERSION)
+version = 
$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(iatv)$(LOCALVERSION)
 
 # Bug out if the version number id not all lowercase
 lc_version = $(call doit,echo $(version) | tr A-Z a-z)
@@ -163,7 +157,6 @@
  VERSION=[$(VERSION)], PATCHLEVEL=[$(PATCHLEVEL)],                  \
  SUBLEVEL=[$(SUBLEVEL)], EXTRAVERSION=[$(EXTRAVERSION)],            \
  iatv=[$(iatv)], LOCALVERSION=[$(LOCALVERSION)],                    \
- GIT_VERSION=[$(GIT_VERSION)]                                       \
  UTS_RELEASE_VERSION=[$(UTS_RELEASE_VERSION)],                      \
  KERNELRELEASE=[$(KERNELRELEASE)].                                  \
  is not all lowercase. Since the version ends up in the package     \
Only in ruleset.orig: ruleset
diff -ur ruleset.orig/targets/target.mk ruleset/targets/target.mk
--- ruleset.orig/targets/target.mk      2007-07-15 17:55:55.000000000 +0200
+++ ruleset/targets/target.mk   2007-07-15 18:36:21.000000000 +0200
@@ -168,12 +168,6 @@
        @echo "However, I thought the version is $(version)"
        exit 3
 endif
-       # work around idiocy in recent kernel versions
-       test ! -e scripts/package/builddeb || \
-            mv -f scripts/package/builddeb scripts/package/builddeb.kpkg-dist
-       test ! -e scripts/package/Makefile || \
-            (mv -f scripts/package/Makefile scripts/package/Makefile.kpkg-dist 
&& \
-               (echo "# Dummy file "; echo "help:") >  
scripts/package/Makefile)
        @test -f $(LIBLOC)/rules || \
             echo Error: Could not find $(LIBLOC)/rules
        test -d debian || mkdir ./debian

Reply via email to