diff options
Diffstat (limited to 'make-version.pl')
-rwxr-xr-x | make-version.pl | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/make-version.pl b/make-version.pl index bbb580be63..0eee0beaba 100755 --- a/make-version.pl +++ b/make-version.pl @@ -116,8 +116,6 @@ sub read_repo_info { my $in_entries = 0; my $svn_name; my $repo_version; - my $repo_root = undef; - my $repo_url = undef; my $do_hack = 1; my $info_source = "Unknown"; @@ -179,11 +177,6 @@ sub read_repo_info { $commit_id = $parts[-1]; } - chomp($line = qx{git --git-dir=$srcdir/.git ls-remote --get-url origin}); - if (defined($line)) { - $repo_url = $line; - } - # This will break in some cases. Hopefully not during # official package builds. chomp($line = qx{git --git-dir=$srcdir/.git rev-parse --abbrev-ref --symbolic-full-name \@\{upstream\}}); @@ -194,10 +187,12 @@ sub read_repo_info { 1; }; - if ($last_change && $num_commits && $repo_url && $repo_branch) { + if ($last_change && $num_commits && $repo_branch) { $do_hack = 0; } } elsif ($version_pref{"svn_client"}) { + my $repo_root = undef; + my $repo_url = undef; eval { use warnings "all"; no warnings "all"; @@ -220,6 +215,10 @@ sub read_repo_info { 1; }; + if ($repo_url && $repo_root && index($repo_url, $repo_root) == 0) { + $repo_branch = substr($repo_url, length($repo_root)); + } + if ($last_change && $num_commits && $repo_url && $repo_root) { $do_hack = 0; } @@ -316,7 +315,7 @@ sub read_repo_info { if ($do_hack) { # Start of ugly internal SVN file hack if (! open (ENTRIES, "< $srcdir/.svn/entries")) { - print ("Unable to open $srcdir/.svn/entries\n"); + print STDERR "Unable to open $srcdir/.svn/entries\n"; } else { $info_source = "Prodding .svn"; # We need to find out whether our parser can handle the entries file @@ -366,10 +365,6 @@ sub read_repo_info { $package_string = strftime($package_format, gmtime($last_change)); } - if ($repo_url && $repo_root && index($repo_url, $repo_root) == 0) { - $repo_branch = substr($repo_url, length($repo_root)); - } - if ($get_vcs) { print <<"Fin"; Commit distance : $num_commits |