On Mon, 2012-06-04 at 00:32 +0100, Ben Hutchings wrote:
> On Sat, 2012-06-02 at 23:47 +0100, Ben Hutchings wrote:
> [...]
> > Some cleanup that would be nice to get done in linux-2.6 before
> > branching:
> >
> > - rename to linux
> [...]
> > - convert each patch series to quilt format
>
> These two are now done!
>
> > - possibly also convert to source format 3.0 (quilt)
> [...]
>
> Anyone see a problem with this? The big difference is that
> non-featureset patches would be applied at the top level whereas
> currently it's always pristine and they are only applied in
> debian/build/source.
Here's what that change looks like:
Index: debian/bin/gencontrol.py
===================================================================
--- debian/bin/gencontrol.py (revision 19076)
+++ debian/bin/gencontrol.py (working copy)
@@ -109,7 +109,7 @@
# Shortcut to aid architecture bootstrapping
makefile.add('binary-libc-dev_%s' % arch,
- ['source_none_real'],
+ [],
["$(MAKE) -f debian/rules.real install-libc-dev_%s %s" %
(arch, makeflags)])
Index: debian/bin/genorig.py
===================================================================
--- debian/bin/genorig.py (revision 19075)
+++ debian/bin/genorig.py (working copy)
@@ -33,7 +33,7 @@
self.log('Using source name %s, version %s, dfsg %s\n' % (source, version.upstream, self.version_dfsg))
self.orig = '%s-%s' % (source, version.upstream)
- self.orig_tar = '%s_%s.orig.tar.gz' % (source, version.upstream)
+ self.orig_tar = '%s_%s.orig.tar.xz' % (source, version.upstream)
self.tag = 'v' + version.linux_upstream_full
def __call__(self):
@@ -117,7 +117,7 @@
except OSError:
pass
self.log("Generate tarball %s\n" % out)
- cmdline = ['tar -czf', out, '-C', self.dir, self.orig]
+ cmdline = ['tar -cJf', out, '-C', self.dir, self.orig]
try:
if os.spawnv(os.P_WAIT, '/bin/sh', ['sh', '-c', ' '.join(cmdline)]):
raise RuntimeError("Can't patch source")
Index: debian/bin/test-patches
===================================================================
--- debian/bin/test-patches (revision 19077)
+++ debian/bin/test-patches (working copy)
@@ -55,36 +55,42 @@
dch -v "$version" --distribution UNRELEASED "Testing patches $*"
fi
-restrictfeature=
+# Make new directory for patches
+mkdir -p debian/patches/test
+
+# Ignore user's .quiltrc
+alias quilt='quilt --quiltrc -'
+
+# Try to clean up any previous test patches
if [ "$featureset" = none ]; then
- series="series-all"
+ while quilt top 2>/dev/null | grep -q ^test/; do
+ quilt delete
+ done
else
- series="series-${featureset}"
+ sed -i '/^test\//d' debian/patches/series-${featureset}
fi
-# Copy all patches into a new directory
+# Prepare a new directory for the patches
rm -rf debian/patches/test/
mkdir debian/patches/test
-cp -t debian/patches/test/ "$@"
-# Try to clean up any test patches on exit, but also do it now just in case
-sed -i '/^test\//d' debian/patches/"$series"
-trap "sed -i '/^test\//d' debian/patches/\"$series\"" EXIT
-
-# Append to patch series
-for patch in "$@"; do
- echo "test/$(basename "$patch")" >>debian/patches/"$series"
-done
-
# Regenerate control and included rules
rm debian/control debian/rules.gen
debian/rules debian/control-real && exit 1 || true
test -f debian/control
test -f debian/rules.gen
-# Clean and patch source
+# Clean up old build; apply existing patches for featureset
debian/rules clean
debian/rules source
+# Apply the additional patches
+for patch in "$@"; do
+ patch_abs="$(readlink -f "$patch")"
+ (cd "debian/build/source_${featureset}" && \
+ quilt import -P "test/$(basename "$patch")" "$patch_abs" && \
+ quilt push --fuzz=0)
+done
+
# Build selected binaries
fakeroot make -f debian/rules.gen binary-arch_"$arch"_"$featureset"_"$flavour"
Index: debian/rules.real
===================================================================
--- debian/rules.real (revision 19077)
+++ debian/rules.real (working copy)
@@ -60,37 +60,31 @@
$(BUILD_DIR)/config.$(ARCH)_$(FEATURESET)_$(FLAVOUR): $(KCONFIG)
python debian/bin/kconfig.py '$@' $(KCONFIG) $(KCONFIG_OPTIONS)
-$(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2: SOURCE_DIR=$(BUILD_DIR)/source
+define copy_source
+rsync --delete --exclude debian --exclude .pc --exclude .svk --exclude .svn --link-dest=. -a . '$(1)'
+endef
+
$(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2: DIR = $(BUILD_DIR)/linux-source-$(UPSTREAMVERSION)
-$(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2: $(STAMPS_DIR)/source
+$(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2:
rm -rf '$@' '$(DIR)'
- cp -al '$(SOURCE_DIR)' '$(DIR)'
+ $(call copy_source,$(DIR))
chmod -R u+rw,go=rX '$(DIR)'
cd '$(BUILD_DIR)'; tar -cjf 'linux-source-$(UPSTREAMVERSION).tar.bz2' 'linux-source-$(UPSTREAMVERSION)'
rm -rf '$(DIR)'
define patch_cmd
-cd '$(DIR)' && QUILT_PATCHES='$(CURDIR)/debian/patches' QUILT_SERIES=series-$(1) quilt push --quiltrc - -a -q --fuzz=1
+cd '$(DIR)' && QUILT_PATCHES='$(CURDIR)/debian/patches' QUILT_SERIES=series-$(1) quilt push --quiltrc - -a -q --fuzz=0
endef
-$(STAMPS_DIR)/source: SOURCE_FILES = $(filter-out debian, $(wildcard * .[^.]*))
-$(STAMPS_DIR)/source: DIR = $(BUILD_DIR)/source
-$(STAMPS_DIR)/source:
- rm -rf '$(DIR)'
- mkdir -p '$(DIR)'
- cp -al $(SOURCE_FILES) '$(DIR)'
- $(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_$(FEATURESET):
+ mkdir -p '$(BUILD_DIR)'
rm -rf '$(DIR)'
ifeq ($(FEATURESET),none)
- ln -s source '$(DIR)'
+ ln -s '$(CURDIR)' '$(DIR)'
else
- cp -al '$(SOURCE_DIR)' '$(DIR)'
- rm -rf '$(DIR)/.pc'
+ $(call copy_source,$(DIR))
$(call patch_cmd,$(FEATURESET))
endif
@$(stamp)
@@ -136,13 +130,12 @@
python debian/bin/buildcheck.py $(DIR) $(ARCH) $(FEATURESET) $(FLAVOUR)
@$(stamp)
-$(STAMPS_DIR)/build-doc: SOURCE_DIR=$(BUILD_DIR)/source
$(STAMPS_DIR)/build-doc: DIR=$(BUILD_DIR)/build-doc
-$(STAMPS_DIR)/build-doc: $(STAMPS_DIR)/source
+$(STAMPS_DIR)/build-doc:
rm -rf $(DIR)
- mkdir $(DIR)
- +$(MAKE_CLEAN) -C $(SOURCE_DIR) O='$(CURDIR)/$(DIR)' xmldocs
- +$(MAKE_CLEAN) -C $(SOURCE_DIR) O='$(CURDIR)/$(DIR)' htmldocs mandocs
+ mkdir -p $(DIR)
+ +$(MAKE_CLEAN) O='$(CURDIR)/$(DIR)' xmldocs
+ +$(MAKE_CLEAN) O='$(CURDIR)/$(DIR)' htmldocs mandocs
@$(stamp)
install-base:
@@ -164,14 +157,13 @@
install-doc: PACKAGE_NAME = linux-doc-$(VERSION)
install-doc: DIR = $(BUILD_DIR)/build-doc
-install-doc: SOURCE_DIR = $(BUILD_DIR)/source
install-doc: PACKAGE_DIR = debian/$(PACKAGE_NAME)
install-doc: OUT_DIR = $(PACKAGE_DIR)/usr/share/doc/$(PACKAGE_NAME)
install-doc: DH_OPTIONS = -p$(PACKAGE_NAME)
install-doc: $(STAMPS_DIR)/build-doc
dh_prep
mkdir -p $(OUT_DIR)
- cp -a $(addprefix $(SOURCE_DIR)/, CREDITS MAINTAINERS README REPORTING-BUGS Documentation) $(OUT_DIR)
+ cp -a CREDITS MAINTAINERS README REPORTING-BUGS Documentation $(OUT_DIR)
rm -rf $(OUT_DIR)/Documentation/DocBook
cd $(DIR)/Documentation/DocBook; \
find * -name '*.html' -print \
@@ -280,7 +272,6 @@
install-libc-dev_$(ARCH): PACKAGE_NAME = linux-libc-dev
install-libc-dev_$(ARCH): DH_OPTIONS = -p$(PACKAGE_NAME)
-install-libc-dev_$(ARCH): SOURCE_DIR = $(BUILD_DIR)/source
install-libc-dev_$(ARCH): DIR = $(BUILD_DIR)/build-libc-dev
install-libc-dev_$(ARCH): OUT_DIR = debian/$(PACKAGE_NAME)/usr
install-libc-dev_$(ARCH):
@@ -288,9 +279,9 @@
dh_testroot
dh_prep
rm -rf '$(DIR)'
- mkdir $(DIR)
- +$(MAKE_CLEAN) -C $(SOURCE_DIR) O='$(CURDIR)/$(DIR)' headers_check ARCH=$(KERNEL_ARCH)
- +$(MAKE_CLEAN) -C $(SOURCE_DIR) O='$(CURDIR)/$(DIR)' headers_install ARCH=$(KERNEL_ARCH) INSTALL_HDR_PATH='$(CURDIR)'/$(OUT_DIR)
+ mkdir -p $(DIR)
+ +$(MAKE_CLEAN) O='$(CURDIR)/$(DIR)' headers_check ARCH=$(KERNEL_ARCH)
+ +$(MAKE_CLEAN) O='$(CURDIR)/$(DIR)' headers_install ARCH=$(KERNEL_ARCH) INSTALL_HDR_PATH='$(CURDIR)'/$(OUT_DIR)
rm -rf $(OUT_DIR)/include/drm $(OUT_DIR)/include/scsi
find $(OUT_DIR)/include \( -name .install -o -name ..install.cmd \) -execdir rm {} +
Index: debian/changelog
===================================================================
--- debian/changelog (revision 19077)
+++ debian/changelog (working copy)
@@ -16,7 +16,9 @@
* linux-patch-debian: Remove; it is no longer necessary for GPL compliance
and does not work with our current patch management
* test-patches: Recognise the rt featureset automatically
- * Convert patch system to quilt, except for the 'orig' patch series
+ * Convert source package format to 3.0 (quilt)
+ - Convert patch system to quilt, except for the 'orig' patch series
+ - Use xz compression for upstream and Debian tarballs
-- Ben Hutchings <ben@decadent.org.uk> Sat, 02 Jun 2012 20:31:53 +0100
Index: debian/rules
===================================================================
--- debian/rules (revision 19075)
+++ debian/rules (working copy)
@@ -39,18 +39,20 @@
@$(stamp)
DIR_ORIG = ../orig/$(SOURCE)-$(VERSION_UPSTREAM)
-TAR_ORIG_NAME = $(SOURCE)_$(VERSION_UPSTREAM).orig.tar.gz
+TAR_ORIG_NAME = $(SOURCE)_$(VERSION_UPSTREAM).orig.tar.xz
TAR_ORIG = $(firstword $(wildcard ../$(TAR_ORIG_NAME)) $(wildcard ../orig/$(TAR_ORIG_NAME)))
orig: $(DIR_ORIG)
+ rm -rf .pc
rsync --delete --exclude debian --exclude .svk --exclude .svn --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ .
+ QUILT_PATCHES='$(CURDIR)/debian/patches' quilt push --quiltrc - -a -q --fuzz=0
$(DIR_ORIG):
ifeq ($(TAR_ORIG),)
$(error Cannot find orig tarball $(TAR_ORIG_NAME))
else
mkdir -p ../orig
- tar -C ../orig -xzf $(TAR_ORIG)
+ tar -C ../orig -xJf $(TAR_ORIG)
endif
maintainerclean:
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, rsync
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/source/options
===================================================================
--- debian/source/options (revision 0)
+++ debian/source/options (revision 0)
@@ -0,0 +1 @@
+compression = "xz"
Index: debian/source/local-options
===================================================================
--- debian/source/local-options (revision 0)
+++ debian/source/local-options (revision 0)
@@ -0,0 +1 @@
+abort-on-upstream-changes
Index: debian/source/format
===================================================================
--- debian/source/format (revision 19075)
+++ debian/source/format (working copy)
@@ -1,2 +1,2 @@
-1.0
+3.0 (quilt)
--- END ---
Plus renaming of debian/patches/series-all to debian/patches/series.
dpkg-source requires fuzz of 0, so I changed our invocations of quilt to
be consistent with that. This might become an annoyance. However I
only found 4 existing patches with fuzz of 1, which I've now refreshed.
Should the source and build rules try to check or ensure that all the
non-featureset patches have been pushed?
Ben.
--
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