-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathquesta_install.sh
executable file
·136 lines (130 loc) · 3.9 KB
/
questa_install.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/bin/bash
export LC_ALL=en_US.UTF-8
# ***************************************************************************************
# *** This file is provided as-is. Modifications to this file are at your own risk. ***
# *** The End User License Agreement was accepted during the creation of this script ***
# *** by the user: [email protected]
# ***************************************************************************************
# Generated by MIP v6.0-010
PROMPT_TARG="F"
MIPPATH="/opt/QuestaSim_2021.2.1_lin64/questa_sim-2021.2_1.aol"
export MG_INSTALL_PID=`uname -n`-`date +%H.%M.%S`${RANDOM}
if [ "$HOME" = "" ]; then
echo HOME env variable is not set. Please set it to your home directory.
exit 1
fi
if [[ ! -d "$HOME" ]]; then
echo HOME does not resolve to a valid directory.
exit 1
fi
MIP_PATH_ERRORS=0
MIP_START_DIR=$HOME/mgc/$(basename "$MIPPATH")
NEWTARG=
NEWSRC=
NEWMIPLOC=
NEWDOCLOC=
SELF=`dirname "$(readlink -f $0)"`
SELF=$SELF/$(basename $0)
MIPBATCMD="-batch"
MIPBATPATH=`echo "$SELF"`
MIPSKIP=
MIPEXTRAARGS=
MIPTARG="/opt"
MIPSRC="/opt/QuestaSim_2021.2.1_lin64/questa_sim-2021.2_1.aol"
while [ $# -gt 0 ];
do
if [ "$1" = "-tgt" ]; then
shift
NEWTARG=`echo -tgt \'"$1"\'`
PROMPT_TARG=F
elif [ "$1" = "-src" ]; then
shift
NEWSRC=`echo -src \'"$1"\'`
elif [ "$1" = "-accesspath" ]; then
shift
NEWDOCLOC=`echo -accesspath \'"$1"\'`
elif [ "$1" = "-msiloc" ]; then
shift
NEWMIPLOC=`echo -msiloc "$1"`
MIP_START_DIR="$1"
elif [ "$1" = "-batchremove" ]; then
MIPBATCMD=`echo -block $1`
MIPSKIP="T"
elif [ "$1" = "-batchverify" ]; then
MIPBATCMD=`echo -block $1`
MIPSKIP="T"
elif [ "$1" = "-repair" ]; then
EXTRAARGS=`echo $EXTRAARGS "$1"`
elif [ "$1" = "-nojw" ]; then
EXTRAARGS=`echo $EXTRAARGS "$1"`
elif [ "$1" = "-deleteUserModifiedFiles" ]; then
EXTRAARGS=`echo $EXTRAARGS "$1"`
elif [ "$1" = "-batchall" ]; then
MIPBATCMD=`echo $1 -tgt "$MIPTARG"`
MIPBATPATH=`echo -src "$MIPSRC"`
elif [ "$1" = "-batchlicensed" ]; then
MIPBATCMD=`echo $1 -tgt "$MIPTARG"`
MIPBATPATH=`echo -src "$MIPSRC"`
elif [ "$1" = "-batchupdate" ]; then
MIPBATCMD=`echo $1 -tgt "$MIPTARG"`
MIPBATPATH=`echo -src "$MIPSRC"`
else
echo "USAGE: $0 [-tgt <target>] [-src <source>] [-msiloc <path>] [-batchremove] [-repair]"
exit 1
fi
shift
done
while [ ! -f "$MIPPATH" ];
do
if [ "$MIPPATH" = "x" ]; then
exit
fi
MIP_PATH_ERRORS=$((MIP_PATH_ERRORS + 1))
if [ "$MIP_PATH_ERRORS" -gt 9 ]; then
exit 1
fi
echo "Could not find MIPPATH of: '$MIPPATH'"
echo "Enter path to install.* (or 'x' to quit): "
read MIPPATH
done
if [ "$PROMPT_TARG" = "T" ]; then
echo "Enter a Target Directory: "
read ENTERED_TARG
ENTERED_TARG=`echo $ENTERED_TARG | sed 's/"//g'`
NEWTARG=`echo -tgt \'"$ENTERED_TARG"\'`
fi
if [ ! "$MIPSKIP" = "T" ]; then
:
# *** ADD YOUR OWN PRE INSTALL COMMANDS BELOW HERE ***
# *** ADD YOUR OWN PRE INSTALL COMMANDS ABOVE HERE ***
fi
"$MIPPATH" $MIPBATCMD "$MIPBATPATH" $NEWTARG $NEWSRC $NEWDOCLOC $NEWMIPLOC $EXTRAARGS <<!!
d
yes
!!
INSTALLEXIT=$?
if [ ! "$MIPSKIP" = "T" ]; then
:
"$MIPPATH" -batchverify "$SELF" $NEWTARG $NEWMIPLOC -block
fi
if [ ! "$MIPSKIP" = "T" ]; then
:
# *** ADD YOUR OWN POST INSTALL COMMANDS BELOW HERE ***
# *** ADD YOUR OWN POST INSTALL COMMANDS ABOVE HERE ***
fi
LASTEXIT=$?
if [ $INSTALLEXIT -ne 0 ]; then
exit $INSTALLEXIT
fi
exit $LASTEXIT
##### BELOW HERE IS XML DATA #####
<batchFile>
<source value="/opt/QuestaSim_2021.2.1_lin64/questa_sim-2021.2_1.aol"/>
<target value="/opt"/>
<installType value="all"/>
<platform value="Linux Opteron"/>
<release name="2021.2_1">
<product name="GCC 64-bit" productroot="questa_sim-base"/>
<product name="Questa SIM 64-bit" productroot="questa_sim-base"/>
</release>
</batchFile>