[libdist-zilla-plugin-githubmeta-perl] 01/01: Work around ancient git versions
Axel Beckert
abe at deuxchevaux.org
Sun Apr 26 22:26:04 UTC 2015
This is an automated email from the git hooks/post-receive script.
abe pushed a commit to annotated tag 0.42
in repository libdist-zilla-plugin-githubmeta-perl.
commit 6c90717d27f8938ac462040b97ebec25b420bd31
Author: Chris 'BinGOs' Williams <chris at bingosnet.co.uk>
Date: Mon Sep 30 10:27:02 2013 +0100
Work around ancient git versions
git remote wasn't available until 1.5.0
The output from git remote changed sometime after 1.6.x
---
dist.ini | 3 ++-
lib/Dist/Zilla/Plugin/GithubMeta.pm | 13 ++++++++++++-
t/basic.t | 11 ++++++++++-
3 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/dist.ini b/dist.ini
index 9adbdf6..7e55018 100644
--- a/dist.ini
+++ b/dist.ini
@@ -1,5 +1,5 @@
name = Dist-Zilla-Plugin-GithubMeta
-version = 0.40
+version = 0.42
author = Chris Williams <chris at bingosnet.co.uk>
author = Ricardo SIGNES <rjbs at cpan.org>
license = Perl_5
@@ -16,3 +16,4 @@ Dist::Zilla::Role::MetaProvider = 4.101582
IPC::Cmd = 0
Moose = 1.07
MooseX::Types::URI = 0.03
+version = 0
diff --git a/lib/Dist/Zilla/Plugin/GithubMeta.pm b/lib/Dist/Zilla/Plugin/GithubMeta.pm
index 5f108a1..66194e6 100644
--- a/lib/Dist/Zilla/Plugin/GithubMeta.pm
+++ b/lib/Dist/Zilla/Plugin/GithubMeta.pm
@@ -54,6 +54,17 @@ sub _acquire_repo_info {
require IPC::Cmd;
return unless IPC::Cmd::can_run('git');
+ {
+ my $gitver = `git version`;
+ my ($ver) = $gitver =~ m!git version ([0-9.]+)!;
+ chomp $gitver;
+ require version;
+ if ( version->parse( $ver ) < version->parse('1.5.0') ) {
+ warn "$gitver is too low, 1.5.0 or above is required\n";
+ return;
+ }
+ }
+
my $git_url;
remotelist: for my $remote (@{ $self->remote }) {
# Missing remotes expand to the same value as they were input
@@ -129,7 +140,7 @@ sub _url_for_remote {
my @remote_info = `git remote show -n $remote`;
for my $line (@remote_info) {
chomp $line;
- if ($line =~ /^\s*Fetch URL:\s*(.*)/) {
+ if ($line =~ /^\s*(?:Fetch)?\s*URL:\s*(.*)/) {
return $1;
}
}
diff --git a/t/basic.t b/t/basic.t
index 0e3d25c..da87e0b 100644
--- a/t/basic.t
+++ b/t/basic.t
@@ -11,7 +11,16 @@ unless ( can_run('git') ) {
{
my ($gitver) = `git version`;
- diag("Using $gitver");
+ my ($ver) = $gitver =~ m!git version ([0-9.]+)!;
+ chomp $gitver;
+ require version;
+ if ( version->parse( $ver ) < version->parse('1.5.0') ) {
+ diag("$gitver is too low, 1.5.0 or above is required");
+ ok("$gitver is too low, 1.5.0 or above is required");
+ done_testing;
+ exit 0;
+ }
+ diag("Using $gitver\n");
}
use lib 't/lib';
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libdist-zilla-plugin-githubmeta-perl.git
More information about the Pkg-perl-cvs-commits
mailing list