diff options
author | Ross Burton <ross@burtonini.com> | 2015-10-20 16:55:23 +0200 |
---|---|---|
committer | David Henningsson <david.henningsson@canonical.com> | 2015-10-20 16:55:23 +0200 |
commit | c25b06577c2cc251c541732f245117c913206916 (patch) | |
tree | e2cf0eff1436f934e22b4211bc456a320f31beea /git-version-gen | |
parent | f277f2c5094fb32c5d879923960eb807b3b1c535 (diff) |
git-version-gen: Avoid further processing when tarball-version is present
In case a tarball-version file is present, use that and quit.
Otherwise git will continue looking for directories, potentially
finding .git directories which are dirty and mark the version as such.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90936
Diffstat (limited to 'git-version-gen')
-rwxr-xr-x | git-version-gen | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/git-version-gen b/git-version-gen index 754688441..079b93ec3 100755 --- a/git-version-gen +++ b/git-version-gen @@ -84,7 +84,10 @@ then v=`cat $tarball_version_file` || exit 1 case $v in *$nl*) v= ;; # reject multi-line output - [0-9]*) ;; + [0-9]*) + echo "$v" | tr -d '\012' + exit 0 + ;; *) v= ;; esac test -z "$v" \ |