nyetsche/easybuild-easyblocks — pull request #1 by boegel (2013-05-23 19:17:21+00:00)
Title: patch files before copying, avoid explicitly listing patterns or files to patch

This cleans up/improves/corrects the patch provided in https://github.com/hpcugent/easybuild-easyblocks/pull/197.

The patching is now no longer 'lazy', nor does it require the list the files to patch, so it should keep working if the build dir is hardcoded in more files or in other places in future versions of MUMmer.

I tested this thoroughly. The patching part yields a result like shown below. The build directory that is hardcoded is replaced by the `bin` install dir:

```
--- /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/dnadiff.orig.eb	2013-05-23 21:12:15.000000000 +0200
+++ /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/dnadiff	2013-05-23 21:12:28.000000000 +0200
@@ -9,13 +9,13 @@
#
#-------------------------------------------------------------------------------

-use lib "/Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/scripts";
+use lib "/Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin/scripts";
use Foundation;
use File::Spec::Functions;
use strict;

-my $BIN_DIR = "/Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23";
-my $SCRIPT_DIR = "/Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/scripts";
+my $BIN_DIR = "/Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin";
+my $SCRIPT_DIR = "/Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin/scripts";

my $VERSION_INFO = q~
DNAdiff version 1.3
--- /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/exact-tandems.orig.eb	2013-05-23 21:12:15.000000000 +0200
+++ /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/exact-tandems	2013-05-23 21:12:28.000000000 +0200
@@ -6,8 +6,8 @@
set filename = $1
set matchlen = $2

-set bindir = /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23
-set scriptdir = /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/scripts
+set bindir = /Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin
+set scriptdir = /Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin/scripts

if ($filename == '' || $matchlen == '') then
echo "USAGE: $0 "
--- /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/mapview.orig.eb	2013-05-23 21:12:15.000000000 +0200
+++ /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/mapview	2013-05-23 21:12:28.000000000 +0200
@@ -1,9 +1,9 @@
#!/Users/kehoste/.local/easybuild/software/Perl/5.16.3-goolf-1.4.10/bin/perl

-use lib "/Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/scripts";
+use lib "/Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin/scripts";
use Foundation;

-my $SCRIPT_DIR = "/Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/scripts";
+my $SCRIPT_DIR = "/Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin/scripts";

my $VERSION_INFO = q~
--- /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/mummerplot.orig.eb	2013-05-23 21:12:15.000000000 +0200
+++ /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/mummerplot	2013-05-23 21:12:28.000000000 +0200
@@ -16,13 +16,13 @@
#
################################################################################

-use lib "/Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/scripts";
+use lib "/Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin/scripts";
use Foundation;
use strict;
use IO::Socket;

-my $BIN_DIR = "/Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23";
-my $SCRIPT_DIR = "/Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/scripts";
+my $BIN_DIR = "/Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin";
+my $SCRIPT_DIR = "/Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin/scripts";

#================================================================= Globals ====#
--- /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/nucmer.orig.eb	2013-05-23 21:12:15.000000000 +0200
+++ /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/nucmer	2013-05-23 21:12:28.000000000 +0200
@@ -15,14 +15,14 @@
#
#-------------------------------------------------------------------------------

-use lib "/Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/scripts";
+use lib "/Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin/scripts";
use Foundation;
use File::Spec::Functions;
use strict;

-my $AUX_BIN_DIR = "/Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/aux_bin";
-my $BIN_DIR = "/Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23";
-my $SCRIPT_DIR = "/Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/scripts";
+my $AUX_BIN_DIR = "/Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin/aux_bin";
+my $BIN_DIR = "/Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin";
+my $SCRIPT_DIR = "/Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin/scripts";

my $VERSION_INFO = q~
--- /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/promer.orig.eb	2013-05-23 21:12:15.000000000 +0200
+++ /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/promer	2013-05-23 21:12:28.000000000 +0200
@@ -15,14 +15,14 @@
#
#-------------------------------------------------------------------------------

-use lib "/Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/scripts";
+use lib "/Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin/scripts";
use Foundation;
use File::Spec::Functions;
use strict;

-my $AUX_BIN_DIR = "/Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/aux_bin";
-my $BIN_DIR = "/Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23";
-my $SCRIPT_DIR = "/Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/scripts";
+my $AUX_BIN_DIR = "/Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin/aux_bin";
+my $BIN_DIR = "/Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin";
+my $SCRIPT_DIR = "/Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin/scripts";

--- /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/run-mummer1.orig.eb	2013-05-23 21:12:15.000000000 +0200
+++ /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/run-mummer1	2013-05-23 21:12:28.000000000 +0200
@@ -10,7 +10,7 @@
set pfx = $3
set rev = $4

-set bindir = /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23
+set bindir = /Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin

if($ref == '' || $qry == '' || $pfx == '') then
echo "USAGE: $0 [-r]"
--- /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/run-mummer3.orig.eb	2013-05-23 21:12:15.000000000 +0200
+++ /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23/run-mummer3	2013-05-23 21:12:28.000000000 +0200
@@ -13,7 +13,7 @@
set qry = $2
set pfx = $3

-set bindir = /Users/kehoste/.local/easybuild/build/MUMmer/3.23/goolf-1.4.10-Perl-5.16.3/MUMmer3.23
+set bindir = /Users/kehoste/.local/easybuild/software/MUMmer/3.23-goolf-1.4.10-Perl-5.16.3/bin

if($ref == '' || $qry == '' || $pfx == '') then
echo "USAGE: $0 "
```