File: addbuildid.sh

package info (click to toggle)
logdata-anomaly-miner 2.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,612 kB
  • sloc: python: 48,247; sh: 4,863; xml: 1,666; makefile: 23
file content (36 lines) | stat: -rwxr-xr-x 693 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh

METAPATH="source/root/usr/lib/logdata-anomaly-miner/metadata.py"
DOCSCONF="docs/conf.py"

# fallback if git is not installed
if [ ! `command -v git` ]
then
	echo "Git is not installed. Won't set the BUILD_ID"
	exit 1
fi

BUILD_ID=`git describe --tags --long 2> /dev/null`

# fallback if this is not a git installation
if [ $? -ne 0 ]
then
	echo "This seems not to be a git installation."
	exit 0
fi

BUILD_ID=`echo $BUILD_ID | sed 's/^[Vv]//'`

echo "BUILD_ID: $BUILD_ID"

if [ -e $METAPATH ]
then
sed  -i  "s/__version__\s*=\s*\".*\"/__version__ = \"$BUILD_ID\"/g" $METAPATH
fi

if [ -e $DOCSCONF ]
then
sed  -i  "s/release\s*=\s*'.*'/release = '$BUILD_ID'/g" $DOCSCONF
fi

exit 0