Skip to contentSkip to conversation

Rename 2.6.12.5 patch so it actually gets applied. Fail

Xen-changelog Muli Ben-Yehuda 1 participant 1 message Oct 19, 2005 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 12 lines · Xen patchbot -unstable

# HG changeset patch
# User [email protected]
# Node ID 4dd58ef396390034f2c448418e0a2bc1be6c7ad0 # Parent aabc33c3c0ac7be9507e4b846b89264d1bd110c0 Rename 2.6.12.5 patch so it actually gets applied. Fail the build if 'patch' is missing.

diff -r aabc33c3c0ac -r 4dd58ef39639 buildconfigs/Rules.mk

buildconfigs/Rules.mk line 88

Quoted 7 lines
buildconfigs/Rules.mk +1 -0
@@ -82,6 +82,7 @@
 ref-%/.valid-ref: pristine-%/.valid-pristine
 	rm -rf $(@D)
 	cp -al $(<D) $(@D)
+	which patch || exit 1
 	([ -d patches/$* ] && \
 	  for i in patches/$*/*.patch ; do ( cd $(@D) ; patch -p1 <../$$i || exit 1 ) ; done) || true
 	touch $@ # update timestamp to avoid rebuild

This will still fail obscurely during the kernel build if patch exists but fails to apply the patches for some reason. Also, I seem to recall there were some issue with unqualified 'which' on some distros. Please reconsider the patch below.

Exporting patch:
# HG changeset patch
# User Muli Ben-Yehuda <[email protected]>
# Node ID 11e4f65368c2a8d1c583ad19621c58d155d0cd20
# Parent 446aa56ca4fee7d3ea2badfb59e8bb3540b507ae building the kernels should fail if patch(1) is not available when patching the kernel, rather than failing later when trying to build the unpatched kernel.
- set -e
- avoid two subshells so that make notices our exit status

buildconfigs/Rules.mk +3 -2
diff -r 446aa56ca4fee7d3ea2badfb59e8bb3540b507ae -r 11e4f65368c2a8d1c583ad19621c58d155d0cd20 buildconfigs/Rules.mk
@@ -80,10 +80,11 @@
 	rm -f patches/*/.makedep
 
 ref-%/.valid-ref: pristine-%/.valid-pristine
+	set -e
 	rm -rf $(@D)
 	cp -al $(<D) $(@D)
-	([ -d patches/$* ] && \
-	  for i in patches/$*/*.patch ; do ( cd $(@D) ; patch -p1 <../$$i || exit 1 ) ; done) || true
+	[ -d patches/$* ] || exit 1
+	for i in patches/$*/*.patch ; do cd $(@D) ; patch -p1 <../$$i || exit 1; done
 	touch $@ # update timestamp to avoid rebuild
 endif
 

Cheers,
Muli

Signature · 2 lines
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/