mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-22 14:20:40 +01:00
Allow 'get_script_version' to correctly handle point releases
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
7b52d812ae
commit
41d709b043
@ -31,6 +31,7 @@ get_script_version() { # $1 = script
|
|||||||
local temp
|
local temp
|
||||||
local version
|
local version
|
||||||
local ifs
|
local ifs
|
||||||
|
local digits
|
||||||
|
|
||||||
temp=$( $SHOREWALL_SHELL $1 version | sed 's/-.*//' )
|
temp=$( $SHOREWALL_SHELL $1 version | sed 's/-.*//' )
|
||||||
|
|
||||||
@ -41,9 +42,12 @@ get_script_version() { # $1 = script
|
|||||||
IFS=.
|
IFS=.
|
||||||
temp=$(echo $temp)
|
temp=$(echo $temp)
|
||||||
IFS=$ifs
|
IFS=$ifs
|
||||||
|
digits=0
|
||||||
|
|
||||||
for temp in $temp; do
|
for temp in $temp; do
|
||||||
version=${version}$(printf '%02d' $temp)
|
version=${version}$(printf '%02d' $temp)
|
||||||
|
digits=$(($digits + 1))
|
||||||
|
[ $digits -eq 3 ] && break
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ get_script_version() { # $1 = script
|
|||||||
local temp
|
local temp
|
||||||
local version
|
local version
|
||||||
local ifs
|
local ifs
|
||||||
|
local digits
|
||||||
|
|
||||||
temp=$( $SHOREWALL_SHELL $1 version | sed 's/-.*//' )
|
temp=$( $SHOREWALL_SHELL $1 version | sed 's/-.*//' )
|
||||||
|
|
||||||
@ -40,9 +41,12 @@ get_script_version() { # $1 = script
|
|||||||
IFS=.
|
IFS=.
|
||||||
temp=$(echo $temp)
|
temp=$(echo $temp)
|
||||||
IFS=$ifs
|
IFS=$ifs
|
||||||
|
digits=0
|
||||||
|
|
||||||
for temp in $temp; do
|
for temp in $temp; do
|
||||||
version=${version}$(printf '%02d' $temp)
|
version=${version}$(printf '%02d' $temp)
|
||||||
|
digits=$(($digits + 1))
|
||||||
|
[ $digits -eq 3 ] && break
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user