source: rtems/cpukit/sapi/vc-key.sh @ 65f868c

5
Last change on this file since 65f868c was f5b3c024, checked in by Martin Erik Werner <martinerikwerner@…>, on 11/12/17 at 14:39:53

Fix bashism in vc-key.sh

Change "==" to "=", since "==" for comparison is not available in POSIX
sh.

Signed-off-by: Martin Erik Werner <martinerikwerner@…>

  • Property mode set to 100755
File size: 655 bytes
Line 
1#! /bin/sh
2
3git=$(command -v git)
4
5#
6# Git command not found or not a valid git repo is a release.
7#
8vc_ident="release"
9
10if test $# -ge 1; then
11 repo=$1
12 shift
13 if test -d $repo; then
14  cwd=$(pwd)
15  cd $repo
16  if test -n ${git}; then
17   git rev-parse --git-dir > /dev/null 2>&1
18   if test $? = 0; then
19    git status > /dev/null 2>&1
20    if git diff-index --quiet HEAD --; then
21     modified=""
22    else
23     modified="-modified"
24    fi
25    vc_ident="$(git rev-parse --verify HEAD)${modified}"
26    if test $# -ge 1; then
27     if test "${vc_ident}" = "$1"; then
28      vc_ident="matches"
29     fi
30    fi
31   fi
32  fi
33  cd $cwd
34 fi
35fi
36
37echo ${vc_ident}
38
39exit 0
Note: See TracBrowser for help on using the repository browser.