develooper Front page | perl.perl5.porters | Postings from October 2012

porting/cmp_version

Thread Next
From:
hv
Date:
October 25, 2012 00:17
Subject:
porting/cmp_version
Message ID:
201210250626.q9P6QXu27271@crypt.org
A test run in a clone of a perl from github/ruz gave this:
t/porting/cmp_version ......................................... fatal: No names found, cannot describe anything.
ok

The warning comes because there are no tags here, and the git-describe
call's stderr is allowed to leak out.

The "ok" comes because after checking, we have $tag_to_compare and
$tag_exists both being an empty string, and treat that as a successfully
found tag.

I'm not particularly sure, but I suspect something like the patch below
is all that's needed.

Hugo
---

diff --git a/Porting/cmpVERSION.pl b/Porting/cmpVERSION.pl
index 97c78b2..525ffe1 100755
--- a/Porting/cmpVERSION.pl
+++ b/Porting/cmpVERSION.pl
@@ -39,10 +39,17 @@ my $null = devnull();
 unless (defined $tag_to_compare) {
     # Thanks to David Golden for this suggestion.
 
-    $tag_to_compare = `git describe --abbrev=0`;
+    $tag_to_compare = `git describe --abbrev=0 2>$null`;
     chomp $tag_to_compare;
 }
 
+unless (length $tag_to_compare) {
+    die "$0: Git found, but no Git tags found\n"
+	unless $tap;
+    print "1..0 # SKIP: Git found, but no Git tags found\n";
+    exit 0;
+}
+
 my $tag_exists = `git --no-pager tag -l $tag_to_compare 2>$null`;
 chomp $tag_exists;
 

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About