Skip to content

Commit 24901f0

Browse files
committed
klayout version check
Signed-off-by: vijayank88 <[email protected]>
1 parent be9452e commit 24901f0

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

etc/DependencyInstaller.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ fi
1212
# package versions
1313
klayoutVersion=0.28.8
1414

15-
_versionCompare(){
16-
local a b IFS=. ; set -f
17-
printf -v a %08d $1; printf -v b %08d $3
18-
test $a "$2" $b
15+
_versionCompare() {
16+
local a b IFS=. ; set -f
17+
printf -v a %08d $1; printf -v b %08d $3
18+
test $a "$2" $b
1919
}
2020

2121
_installORDependencies() {
@@ -48,10 +48,8 @@ _installCentosPackages() {
4848
if ! [ -x "$(command -v klayout)" ]; then
4949
yum install -y https://www.klayout.org/downloads/CentOS_7/klayout-${klayoutVersion}-0.x86_64.rpm
5050
else
51-
currentVersion="$(klayout -v)"
52-
currentVersion=$(echo $currentVersion | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
53-
requiredVersion=$(echo $klayoutVersion)
54-
if _versionCompare $currentVersion -ge $requiredVersion; then
51+
currentVersion=$(klayout -v | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
52+
if _versionCompare $currentVersion -ge $klayoutVersion; then
5553
echo "KLayout version greater than or equal to ${klayoutVersion}"
5654
else
5755
echo "KLayout version less than ${klayoutVersion}"

0 commit comments

Comments
 (0)