[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Featureset patches in linux-source package



The linux-patch-debian packages have been broken for a while and will no
longer be built.

But it seems to me that we should be packaging featureset patches in
some easily usable way for those who want to build custom
configurations.

Here's a patch that would add them to the linux-source packages.  (This
conflicts with the other patch I just sent for converting to a version
3.0 package, but that's fairly easily resolvable.)

Does this seem reasonable?

Incidentally, should we switch compression for the packaged files from
bzip2 to xz?

Index: debian/templates/control.source.in
===================================================================
--- debian/templates/control.source.in	(revision 19077)
+++ debian/templates/control.source.in	(working copy)
@@ -3,7 +3,7 @@
 Maintainer: Debian Kernel Team <debian-kernel@lists.debian.org>
 Uploaders: Bastian Blank <waldi@debian.org>, Frederik Schüler <fs@debian.org>, maximilian attems <maks@debian.org>, Ben Hutchings <ben@decadent.org.uk>
 Standards-Version: 3.9.2
-Build-Depends: debhelper (>> 7), cpio, kmod | module-init-tools, python (>= 2.6.6-3~), lzma [armel], kernel-wedge (>= 2.83), quilt
+Build-Depends: debhelper (>> 7), cpio, kmod | module-init-tools, python (>= 2.6.6-3~), lzma [armel], kernel-wedge (>= 2.83), quilt, patchutils
 Build-Depends-Indep: bzip2, xmlto
 Vcs-Svn: svn://svn.debian.org/svn/kernel/dists/trunk/linux/
 Vcs-Browser: http://anonscm.debian.org/viewvc/kernel/dists/trunk/linux/
Index: debian/lib/python/debian_linux/gencontrol.py
===================================================================
--- debian/lib/python/debian_linux/gencontrol.py	(revision 19075)
+++ debian/lib/python/debian_linux/gencontrol.py	(working copy)
@@ -114,6 +114,8 @@
         pass
 
     def do_main_makefile(self, makefile, makeflags, extra):
+        makeflags = makeflags.copy()
+        makeflags['ALL_FEATURESETS'] = ' '.join(self.config['base', ]['featuresets'])
         makefile.add('binary-indep', cmds=["$(MAKE) -f debian/rules.real binary-indep %s" % makeflags])
 
     def do_main_packages(self, packages, vars, makeflags, extra):
Index: debian/rules.real
===================================================================
--- debian/rules.real	(revision 19077)
+++ debian/rules.real	(working copy)
@@ -69,6 +69,15 @@
 	cd '$(BUILD_DIR)'; tar -cjf 'linux-source-$(UPSTREAMVERSION).tar.bz2' 'linux-source-$(UPSTREAMVERSION)'
 	rm -rf '$(DIR)'
 
+$(BUILD_DIR)/linux-patch-$(UPSTREAMVERSION)-%.patch.bz2: $(STAMPS_DIR)/source_%
+	set -o pipefail; \
+	(cd '$(BUILD_DIR)'; \
+	 diff -urN -p -x debian -x .pc -x .svk -x .svn source source_$* || \
+	 test $$? -eq 1) | \
+	 filterdiff --remove-timestamps --strip=1 --addoldprefix=a/ --addnewprefix=b/ | \
+	 bzip2 -c >$@ || \
+	(rm -f $@; exit 1)
+
 define patch_cmd
 cd '$(DIR)' && QUILT_PATCHES='$(CURDIR)/debian/patches' QUILT_SERIES=series-$(1) quilt push --quiltrc - -a -q --fuzz=1
 endef
@@ -82,18 +91,19 @@
 	$(call patch_cmd,all)
 	@$(stamp)
 
-$(STAMPS_DIR)/source_$(FEATURESET): SOURCE_DIR=$(BUILD_DIR)/source
-$(STAMPS_DIR)/source_$(FEATURESET): DIR=$(BUILD_DIR)/source_$(FEATURESET)
-$(STAMPS_DIR)/source_$(FEATURESET): $(STAMPS_DIR)/source
+$(STAMPS_DIR)/source_%: SOURCE_DIR=$(BUILD_DIR)/source
+$(STAMPS_DIR)/source_%: DIR=$(BUILD_DIR)/source_$*
+$(STAMPS_DIR)/source_%: SOURCE_DIR=$(BUILD_DIR)/source
+$(STAMPS_DIR)/source_%: $(STAMPS_DIR)/source
 	rm -rf '$(DIR)'
-ifeq ($(FEATURESET),none)
-	ln -s source '$(DIR)'
-else
 	cp -al '$(SOURCE_DIR)' '$(DIR)'
 	rm -rf '$(DIR)/.pc'
-	$(call patch_cmd,$(FEATURESET))
-endif
+	$(call patch_cmd,$*)
 	@$(stamp)
+$(STAMPS_DIR)/source_none: $(STAMPS_DIR)/source
+	rm -f '$(DIR)'
+	ln -s source '$(DIR)'
+	@$(stamp)
 
 $(STAMPS_DIR)/setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR): CONFIG=$(BUILD_DIR)/config.$(ARCH)_$(FEATURESET)_$(FLAVOUR)
 $(STAMPS_DIR)/setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR): SOURCE_DIR=$(BUILD_DIR)/source_$(FEATURESET)
@@ -477,10 +487,10 @@
 	dh_builddeb
 
 install-source: DH_OPTIONS = -plinux-source-$(VERSION)
-install-source: $(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2
+install-source: $(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2 $(foreach FEATURESET,$(filter-out none,$(ALL_FEATURESETS)),$(BUILD_DIR)/linux-patch-$(UPSTREAMVERSION)-$(FEATURESET).patch.bz2)
 	dh_testdir
 	dh_testroot
-	dh_install '$<' /usr/src
+	dh_install '$^' /usr/src
 	+$(MAKE_SELF) install-base
 
 # vim: filetype=make
--- END ---

-- 
Ben Hutchings
It is impossible to make anything foolproof because fools are so ingenious.

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: