changeset 735:3dcb98b57732

* Makefile.am (patch.stamp): Stop and fail when patch doesn't apply. (clean-patch): Warn and fail when patch doesn't revert. (patch-ecj.stamp): Fail when patch doesn't apply. (clean-patch-ecj): Fail when patch doesn't revert. * Makefile.in: Regenerated.
author Mark Wielaard <mark@klomp.org>
date Sun, 17 Feb 2008 22:09:02 +0100
parents f4c290e9611f
children f1a5b84676e3
files ChangeLog Makefile.am Makefile.in
diffstat 3 files changed, 63 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Feb 17 15:39:42 2008 -0500
+++ b/ChangeLog	Sun Feb 17 22:09:02 2008 +0100
@@ -1,3 +1,11 @@
+2008-02-17  Mark Wielaard  <mark@klomp.org>
+
+	* Makefile.am (patch.stamp): Stop and fail when patch doesn't apply.
+	(clean-patch): Warn and fail when patch doesn't revert.
+	(patch-ecj.stamp): Fail when patch doesn't apply.
+	(clean-patch-ecj): Fail when patch doesn't revert.
+	* Makefile.in: Regenerated.
+
 2008-02-15  Lillian Angel  <langel@redhat.com>
 
 	* patches/icedtea-zero.patch: Added patch to add LIBFFI_CFLAGS to
--- a/Makefile.am	Sun Feb 17 15:39:42 2008 -0500
+++ b/Makefile.am	Sun Feb 17 22:09:02 2008 +0100
@@ -240,29 +240,45 @@
 	rm -f stamps/extract.stamp
 
 stamps/patch.stamp: stamps/extract.stamp
+	all_patches_ok=yes; \
 	for p in $(ICEDTEA_PATCHES) ; \
 	do \
-	  echo Checking $$p ; \
-	  if $(PATCH) -l -p0 --dry-run -s -t -f -F 0 < $$p ; \
+	  if test x$${all_patches_ok} == "xyes" \
+	     && echo Checking $$p \
+	     && $(PATCH) -l -p0 --dry-run -s -t -f -F 0 < $$p ; \
 	  then \
 	    echo Applying $$p ; \
 	    $(PATCH) -l -p0 < $$p ; \
+	  else \
+	    test x$${all_patches_ok} == "xyes" && all_patches_ok=$$p ; \
 	  fi ; \
-	done
-	mkdir -p stamps
-	touch stamps/patch.stamp
+	done ; \
+	mkdir -p stamps ; \
+	touch stamps/patch.stamp ; \
+	if ! test x$${all_patches_ok} == "xyes"; then \
+	  echo ERROR patch $${all_patches_ok} FAILED! ; \
+	  echo WARNING make clean-patch before retrying a fix ; \
+	  false; \
+       fi
+
 
 clean-patch:
 	rm -f stamps/patch.stamp
 	for p in $(ICEDTEA_PATCHES) ; \
+	all_patches_ok=yes; \
 	do \
 	  echo Checking $$p ; \
 	  if $(PATCH) -l -p0 -R --dry-run -s -t -f < $$p ; \
 	  then \
 	    echo Reverting $$p ; \
 	    $(PATCH) -l -p0 -R < $$p ; \
+	  else \
+	    all_patches_ok=no ; \
 	  fi ; \
-	done
+	done ; \
+	if ! test x$${all_patches_ok} == "xyes" ; then \
+	  echo "WARNING Not all patches reverted cleanly" ; \
+	fi
 
 # OpenJDK ecj Source Preparation Targets
 # ======================================
@@ -300,9 +316,11 @@
 	then \
 	  echo Applying $(ICEDTEA_ECJ_PATCH) ; \
 	  $(PATCH) -p0 -l < $(ICEDTEA_ECJ_PATCH) ; \
+	  mkdir -p stamps; \
+	  touch stamps/patch-ecj.stamp; \
+	else \
+	  false; \
 	fi
-	mkdir -p stamps
-	touch stamps/patch-ecj.stamp
 
 clean-patch-ecj:
 	rm -f stamps/patch-ecj.stamp
@@ -311,6 +329,8 @@
 	then \
 	  echo Reverting $(ICEDTEA_ECJ_PATCH) ; \
 	  $(PATCH) -p0 -l -R < $(ICEDTEA_ECJ_PATCH) ; \
+	else \
+	  false; \
 	fi
 
 # Bootstrap Directory Targets
--- a/Makefile.in	Sun Feb 17 15:39:42 2008 -0500
+++ b/Makefile.in	Sun Feb 17 22:09:02 2008 +0100
@@ -754,29 +754,44 @@
 	rm -f stamps/extract.stamp
 
 stamps/patch.stamp: stamps/extract.stamp
+	all_patches_ok=yes; \
 	for p in $(ICEDTEA_PATCHES) ; \
 	do \
-	  echo Checking $$p ; \
-	  if $(PATCH) -l -p0 --dry-run -s -t -f -F 0 < $$p ; \
+	  if test x$${all_patches_ok} == "xyes" \
+	     && echo Checking $$p \
+	     && $(PATCH) -l -p0 --dry-run -s -t -f -F 0 < $$p ; \
 	  then \
 	    echo Applying $$p ; \
 	    $(PATCH) -l -p0 < $$p ; \
+	  else \
+	    test x$${all_patches_ok} == "xyes" && all_patches_ok=$$p ; \
 	  fi ; \
-	done
-	mkdir -p stamps
-	touch stamps/patch.stamp
+	done ; \
+	mkdir -p stamps ; \
+	touch stamps/patch.stamp ; \
+	if ! test x$${all_patches_ok} == "xyes"; then \
+	  echo ERROR patch $${all_patches_ok} FAILED! ; \
+	  echo WARNING make clean-patch before retrying a fix ; \
+	  false; \
+       fi
 
 clean-patch:
 	rm -f stamps/patch.stamp
 	for p in $(ICEDTEA_PATCHES) ; \
+	all_patches_ok=yes; \
 	do \
 	  echo Checking $$p ; \
 	  if $(PATCH) -l -p0 -R --dry-run -s -t -f < $$p ; \
 	  then \
 	    echo Reverting $$p ; \
 	    $(PATCH) -l -p0 -R < $$p ; \
+	  else \
+	    all_patches_ok=no ; \
 	  fi ; \
-	done
+	done ; \
+	if ! test x$${all_patches_ok} == "xyes" ; then \
+	  echo "WARNING Not all patches reverted cleanly" ; \
+	fi
 
 # OpenJDK ecj Source Preparation Targets
 # ======================================
@@ -811,9 +826,11 @@
 	then \
 	  echo Applying $(ICEDTEA_ECJ_PATCH) ; \
 	  $(PATCH) -p0 -l < $(ICEDTEA_ECJ_PATCH) ; \
+	  mkdir -p stamps; \
+	  touch stamps/patch-ecj.stamp; \
+	else \
+	  false; \
 	fi
-	mkdir -p stamps
-	touch stamps/patch-ecj.stamp
 
 clean-patch-ecj:
 	rm -f stamps/patch-ecj.stamp
@@ -822,6 +839,8 @@
 	then \
 	  echo Reverting $(ICEDTEA_ECJ_PATCH) ; \
 	  $(PATCH) -p0 -l -R < $(ICEDTEA_ECJ_PATCH) ; \
+	else \
+	  false; \
 	fi
 
 # Bootstrap Directory Targets