File: version.sh

package info (click to toggle)
qstat 2.17-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,220 kB
  • sloc: ansic: 24,706; makefile: 86; perl: 78; sh: 62
file content (13 lines) | stat: -rwxr-xr-x 408 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

if [ "$QSTAT_VERSION" = "" ]; then
	QSTAT_VERSION=`git describe --tags --always`
fi

# Detect if our git repo is in a dirty state (uncommitted changes)
GIT_DIRTY_FILE=`git status --porcelain 2>/dev/null| grep -Fv 'gnuconfig.h.in~' | egrep "^(M| M|\?\?)" | wc -l | sed -e 's/^[[:space:]]*//'`
if [ ${GIT_DIRTY_FILE} -ne 0 ]; then
	QSTAT_VERSION="$QSTAT_VERSION-modified"
fi

echo -n $QSTAT_VERSION