From: Ian Jackson Date: Thu, 10 Sep 2009 13:04:46 +0000 (+0100) Subject: Use "git describe" if "git-describe" isn't on the path X-Git-Tag: 3.5^2~8 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-test.git;a=commitdiff_plain;h=811c58e420d7664366980127cd139b1494baef98;ds=sidebyside Use "git describe" if "git-describe" isn't on the path --- diff --git a/yarrg/Commods.pm b/yarrg/Commods.pm index 7e7b5cc..4d988db 100644 --- a/yarrg/Commods.pm +++ b/yarrg/Commods.pm @@ -251,7 +251,14 @@ sub get_our_version ($$) { $aref->{"${prefix}name"}= 'ypp-sc-tools yarrg'; $aref->{"${prefix}fixes"}= 'lastpage checkpager'; - my $version= `git-describe --tags HEAD || echo 0unknown`; $? and die $?; + my $version= ` + if type -p git-describe >/dev/null 2>&1; then + gd=git-describe + else + gd="git describe" + fi + \$gd --tags HEAD || echo 0unknown + `; $? and die $?; chomp($version); $aref->{"${prefix}version"}= $version; return $aref;