diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2016-02-25 21:34:45 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2016-02-29 22:07:37 +0000 |
commit | d679d1137d884e651b214d8b6e3fb8af2972ad46 (patch) | |
tree | bbdb59dc6404918088ea2ec4cb9ea209316803d0 /make-version.pl | |
parent | bf56f28e7fa22c86fcf953c8586a5980c3a5e82d (diff) |
make-version: Don't emit one common warning to stderr
git rev-parse @{upstream} will (obviously) fail if there is no
upstream set for the current branch. This is fairly common and
not problematic. Don't emit an error message to stderr when it
fails.
Change-Id: I4989fb19b25fefff83335061151e360c78652e88
Reviewed-on: https://code.wireshark.org/review/14151
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'make-version.pl')
-rwxr-xr-x | make-version.pl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/make-version.pl b/make-version.pl index 76fbf2c451..880a77ce1d 100755 --- a/make-version.pl +++ b/make-version.pl @@ -59,6 +59,7 @@ use strict; use Time::Local; use File::Basename; +use File::Spec; use POSIX qw(strftime); use Getopt::Long; use Pod::Usage; @@ -124,6 +125,7 @@ sub read_repo_info { my $repo_version; my $do_hack = 1; my $info_source = "Unknown"; + my $devnull = File::Spec->devnull(); # Make sure git is available. if (!`$git_executable --version`) { @@ -191,7 +193,7 @@ sub read_repo_info { # This will break in some cases. Hopefully not during # official package builds. - chomp($line = qx{$git_executable --git-dir="$srcdir"/.git rev-parse --abbrev-ref --symbolic-full-name \@\{upstream\}}); + chomp($line = qx{$git_executable --git-dir="$srcdir"/.git rev-parse --abbrev-ref --symbolic-full-name \@\{upstream\} 2> $devnull}); if ($? == 0 && length($line) > 1) { $repo_branch = basename($line); } |