[dh-make-perl] 01/01: make: warn if pkg-perl already has a packaging repository for the package
Damyan Ivanov
dmn at alioth.debian.org
Thu Aug 8 19:23:28 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 1f616c1e01a4b9e8bd10925eed89a42673c9ac75
Author: Damyan Ivanov <dmn at debian.org>
Date: Thu Aug 8 21:22:33 2013 +0200
make: warn if pkg-perl already has a packaging repository for the package
both packages/ and attic/ are checked
Closes: #702456
---
lib/DhMakePerl/Command/make.pm | 40 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 38 insertions(+), 2 deletions(-)
diff --git a/lib/DhMakePerl/Command/make.pm b/lib/DhMakePerl/Command/make.pm
index 2daa61b..9cca030 100644
--- a/lib/DhMakePerl/Command/make.pm
+++ b/lib/DhMakePerl/Command/make.pm
@@ -524,6 +524,35 @@ sub create_watch {
$fh->close;
}
+sub search_pkg_perl {
+ my $self = shift;
+
+ return undef unless $self->cfg->network;
+
+ my $pkg = $self->pkgname;
+
+ require LWP::UserAgent;
+ require LWP::ConnCache;
+
+ my ( $ua, $resp );
+
+ $ua = LWP::UserAgent->new;
+ $ua->env_proxy;
+ $ua->conn_cache( LWP::ConnCache->new );
+
+ $resp = $ua->get(
+ "http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/$pkg.git");
+ return { url => $resp->request->uri }
+ if $resp->is_success;
+
+ $resp = $ua->get(
+ "http://anonscm.debian.org/gitweb/?p=pkg-perl/attic/$pkg.git");
+ return { url => $resp->request->uri }
+ if $resp->is_success;
+
+ return undef;
+}
+
sub package_already_exists {
my( $self, $apt_contents ) = @_;
@@ -547,8 +576,7 @@ sub package_already_exists {
warn "Description: $short_desc\n";
}
elsif ($apt_contents) {
- my $found
- = $apt_contents->find_perl_module_package( $self->perlname );
+ $found = $apt_contents->find_perl_module_package( $self->perlname );
if ($found) {
( my $mod_name = $self->perlname ) =~ s/-/::/g;
@@ -557,6 +585,14 @@ sub package_already_exists {
warn " already contains a module named "
. $self->perlname . "\n";
}
+ elsif ( $found = $self->search_pkg_perl ) {
+ warn "********************\n";
+ warn sprintf(
+ "The Debian Perl Group has a repository for the %s package\n at %s\n",
+ $self->pkgname, $found->{url} );
+ warn "You may want to contact them to avoid duplication of effort.\n";
+ warn "More information is available at https://wiki.debian.org/Teams/DebianPerlGroup\n";
+ }
}
else {
( my $mod_name = $self->perlname ) =~ s/-/::/g;
--
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