From bab35039535edd9bbf7dee27812787194a1d58ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lawrence=20Vel=C3=A1zquez?= <larryv@macports.org>
Date: Wed, 18 Mar 2015 02:02:45 -0400
Subject: [PATCH 1/6] lparse: Fix never-failing makefile recipes

Several recipes contain "`make ; cd ..`", so they ignore the exit status
of `make` and always "succeed". Grading on a curve.
---
 dports/science/lparse/Portfile                     |  3 ++-
 .../science/lparse/files/fix-recursive-make.patch  | 28 ++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 dports/science/lparse/files/fix-recursive-make.patch

diff --git a/dports/science/lparse/Portfile b/dports/science/lparse/Portfile
index 76cdcba..0bce756 100644
--- a/dports/science/lparse/Portfile
+++ b/dports/science/lparse/Portfile
@@ -28,7 +28,8 @@ master_sites        ${homepage}/src/
 checksums           rmd160  131f6ea6235eeb7529d2564bb9ce904e5bc2358a \
                     sha256  886d29723f7188296e48584a4a32b8f111414acb7ca8490af28ef6b7f1717298
 
-patchfiles          patch-configure.diff
+patchfiles          patch-configure.diff \
+                    fix-recursive-make.patch
 
 # this configure argument is only used for installing
 configure.pre_args  --prefix=${destroot}${prefix}/bin
diff --git a/dports/science/lparse/files/fix-recursive-make.patch b/dports/science/lparse/files/fix-recursive-make.patch
new file mode 100644
index 0000000..261f846
--- /dev/null
+++ b/dports/science/lparse/files/fix-recursive-make.patch
@@ -0,0 +1,28 @@
+The suffixed "; cd" pipeline causes each recipe to completely ignore the
+exit status of its recursive make invocation, which is bad.
+
+(There's really no need to explicitly change back to the parent
+directory anyway, since make executes recipes in subshells).
+
+Index: Makefile.base
+===================================================================
+--- Makefile.base.orig
++++ Makefile.base
+@@ -1,13 +1,13 @@
+ 
+ lparse :
+-	cd src ; make ; cd ..
++	cd src && $(MAKE)
+ 
+ check :
+-	cd test; make; cd ..
++	cd test && $(MAKE)
+ 
+ clean :
+-	cd src; make clean; cd ..
+-	cd test; make clean; cd ..
++	cd src && $(MAKE) clean
++	cd test && $(MAKE) clean
+ 
+ install : lparse
+ 	cp src/lparse $(INSTALLATION_PATH)/
-- 
2.3.3

