[dh-make-perl] 02/03: make: when neither --cpan or a tarball is given, also try to use debian-named .orig.tar.gz
Damyan Ivanov
dmn at alioth.debian.org
Thu Aug 8 13:58:50 UTC 2013
This is an automated email from the git hooks/post-receive script.
dmn pushed a commit to branch master
in repository dh-make-perl.
commit 6ecdb0de1495a179184548b6f86f8505ccc2396c
Author: Damyan Ivanov <dmn at debian.org>
Date: Thu Aug 8 15:57:40 2013 +0200
make: when neither --cpan or a tarball is given, also try to use debian-named .orig.tar.gz
this may be a leftover of a previous dh-make-perl run
See #689476
---
lib/DhMakePerl/Command/make.pm | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/lib/DhMakePerl/Command/make.pm b/lib/DhMakePerl/Command/make.pm
index cbe22b6..2031f88 100644
--- a/lib/DhMakePerl/Command/make.pm
+++ b/lib/DhMakePerl/Command/make.pm
@@ -82,6 +82,8 @@ sub execute {
$self->extract_basic();
+ $tarball //= $self->guess_tarball;
+
unless ( defined $self->cfg->version ) {
$self->pkgversion( $self->version . '-1' );
}
@@ -246,6 +248,25 @@ sub execute {
return(0);
}
+sub guess_tarball {
+ my $self = shift;
+
+ my $try = catfile( $self->main_dir, '..',
+ $self->control->source->Source . '_'
+ . $self->version
+ . '.orig.tar.gz' );
+
+ print "Trying $try...";
+ if ( -f $try ) {
+ print " found!\n";
+ return $try;
+ }
+ else {
+ print " not found.\n";
+ return undef;
+ }
+}
+
sub setup_dir {
my ($self) = @_;
@@ -340,7 +361,15 @@ sub setup_dir {
$self->main_dir($maindir);
my $guessed_tarball = catfile( $self->start_dir, "..",
basename( $self->start_dir ) . ".tar.gz" );
- $tarball = $guessed_tarball if -f $guessed_tarball;
+
+ print "Trying $guessed_tarball...";
+ if ( -f $guessed_tarball ) {
+ $tarball = $guessed_tarball;
+ print " found.\n";
+ }
+ else {
+ print " not found.\n";
+ }
}
return $tarball;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/dh-make-perl.git
More information about the Pkg-perl-cvs-commits
mailing list