[PATCH] Simple patch to avoid doing work if we're being required and not run.

Paul Fenwick pjf at perltraining.com.au
Tue Nov 25 01:30:09 UTC 2008


---
 dh-make-perl |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/dh-make-perl b/dh-make-perl
index 834d708..80a2f79 100755
--- a/dh-make-perl
+++ b/dh-make-perl
@@ -115,6 +115,11 @@ $startdir  = getcwd();
 $datadir   = '/usr/share/dh-make-perl';
 $homedir   = "$ENV{HOME}/.dh-make-perl";
 
+# If we're being required rather than called as a main command, then
+# return now without doing any work.  This facilitates easier testing.
+
+return 1 if $0 ne __FILE__;
+
 my ( $perlname, $maindir, $modulepm, $meta );
 my ($pkgname, $srcname,
 
@@ -1858,4 +1863,3 @@ Patches from:
 ... And others who, sadly, we have forgot to add :-/
 
 =cut
-
-- 
1.5.5.GIT


--------------020905020405070205070900
Content-Type: text/x-patch;
 name="0003-Basic-tests-for-extract_name_ver_from_autodie.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename*0="0003-Basic-tests-for-extract_name_ver_from_autodie.patch"



More information about the pkg-perl-maintainers mailing list