mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-24 09:58:46 +00:00
Changed: Allow to specify code path and use egrep
This commit is contained in:
parent
5c3e84cf1b
commit
9e71021bab
1 changed files with 13 additions and 7 deletions
18
dist/debian/ryzomcore_version.sh
vendored
18
dist/debian/ryzomcore_version.sh
vendored
|
@ -1,6 +1,11 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
CODEROOT=$1
|
||||||
|
|
||||||
|
if [ -z "$CODEROOT" ]
|
||||||
|
then
|
||||||
CODEROOT=../../code
|
CODEROOT=../../code
|
||||||
|
fi
|
||||||
|
|
||||||
VERSION_FILE=$CODEROOT/CMakeLists.txt
|
VERSION_FILE=$CODEROOT/CMakeLists.txt
|
||||||
|
|
||||||
|
@ -12,10 +17,11 @@ fi
|
||||||
|
|
||||||
parse_version()
|
parse_version()
|
||||||
{
|
{
|
||||||
FILE=$1
|
PREFIX=$1
|
||||||
VAR=$2
|
FILE=$2
|
||||||
|
VAR=$3
|
||||||
|
|
||||||
V=$(grep -o -P "NL_$VAR [0-9]+" $FILE | awk '{print $2}' | head -n 1)
|
V=$(egrep -o $PREFIX"_$VAR [0-9]+" $FILE | awk '{print $2}' | head -n 1)
|
||||||
|
|
||||||
if [ -z "$V" ]
|
if [ -z "$V" ]
|
||||||
then
|
then
|
||||||
|
@ -26,9 +32,9 @@ parse_version()
|
||||||
export $VAR=$V
|
export $VAR=$V
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_version $VERSION_FILE VERSION_MAJOR
|
parse_version NL $VERSION_FILE VERSION_MAJOR
|
||||||
parse_version $VERSION_FILE VERSION_MINOR
|
parse_version NL $VERSION_FILE VERSION_MINOR
|
||||||
parse_version $VERSION_FILE VERSION_PATCH
|
parse_version NL $VERSION_FILE VERSION_PATCH
|
||||||
|
|
||||||
VERSION=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH
|
VERSION=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue