[Build-common-hackers] Bug#220562: cdbs: simple-patchsys.mk does not honour #DPATCHLEVEL

Guillem Jover Guillem Jover <guillem@debian.org>, 220562@bugs.debian.org
Thu, 13 Nov 2003 11:43:20 +0100


--C7zPtVaVf+AK4Oqc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: cdbs
Version: 0.4.13
Tags: patch

Hi,

Current simple-patchsys.mk does not honour #DPATCHLEVEL. Once this is
fixed the code honouring #DPATCHLEVEL is executed and when reversing
a not previously applied patch it fails and exits giving a build error.

Attached is a patch fixing this two issues.

regards,
guillem

--C7zPtVaVf+AK4Oqc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="cdbs_simple-patchsys.patch"

--- simple-patchsys.mk.in	2003-08-27 07:25:53.000000000 +0200
+++ simple-patchsys.mk.in.patched	2003-11-13 11:13:28.000000000 +0100
@@ -49,12 +49,16 @@
 	@echo "patches: $(DEB_PATCHES)"
 	@set -e ; reverse=""; patches="$(DEB_PATCHES)"; \
 	  if [ "$@" = "reverse-patches" ]; then \
+	    if [ ! -e debian/stamp-patched ]; then \
+	      echo "Not reversing not applied patches."; \
+	      exit 0; \
+	    fi; \
 	    reverse="-R"; \
 	    for patch in $$patches; do reversepatches="$$patch $$reversepatches"; done; \
 	    patches="$$reversepatches"; \
 	  fi; \
 	  for patch in $$patches; do \
-	  level=$(head $$patch | egrep '^#DPATCHLEVEL=' | cut -f 2 -d '='); \
+	  level=$$(head $$patch | egrep '^#DPATCHLEVEL=' | cut -f 2 -d '='); \
 	  reverse=""; \
 	  if [ "$@" = "reverse-patches" ]; then reverse="-R"; fi; \
 	  success=""; \

--C7zPtVaVf+AK4Oqc--