"Fossies" - the Fresh Open Source Software Archive

Member "darktable-2.6.3/tools/get_git_version_string.sh" (20 Oct 2019, 502 Bytes) of package /linux/misc/darktable-2.6.3.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 
    3 VERSION="$(git describe --tags --dirty)"
    4 
    5 if [ $? -eq 0 ] ;
    6 then
    7   echo "$VERSION" | sed 's,^release-,,;s,-,+,;s,-,~,;'
    8   exit 0
    9 fi
   10 
   11 # with shallow clones, there may be no tags, so the first ^
   12 # try to get version string will fail
   13 
   14 # in that case let's at least return the commit hash
   15 
   16 VERSION="$(git describe --always --dirty)"
   17 if [ $? -eq 0 ] ;
   18 then
   19   echo "$VERSION"
   20   exit 0
   21 fi
   22 
   23 # failed for some reason. let's just propagate
   24 echo "unknown-version"
   25 exit 0 # to not fail the whole build.