Skip to content

Commit c2beab1

Browse files
committed
etc: DependencyInstaller: Add option for constant build directory
Signed-off-by: Eryk Szpotanski <[email protected]>
1 parent aea19e1 commit c2beab1

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

etc/DependencyInstaller.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,15 @@ _installCommon() {
3636
pip3 install --no-cache-dir --user -U $pkgs
3737
fi
3838

39-
baseDir=$(mktemp -d /tmp/DependencyInstaller-orfs-XXXXXX)
39+
if [[ "$constantBuildDir" == "true" ]]; then
40+
baseDir="/tmp/DependencyInstaller-ORFS"
41+
if [[ -d "$baseDir" ]]; then
42+
echo "[INFO] Removing old building directory $baseDir"
43+
fi
44+
mkdir -p "$baseDir"
45+
else
46+
baseDir=$(mktemp -d /tmp/DependencyInstaller-orfs-XXXXXX)
47+
fi
4048

4149
# Install Verilator
4250
verilatorPrefix=`realpath ${PREFIX:-"/usr/local"}`
@@ -239,6 +247,9 @@ Usage: $0
239247
# sudo or with root access.
240248
$0 -ci
241249
# Installs CI tools
250+
$0 -constant-build-dir
251+
# Use constant build directory, instead of
252+
# random one.
242253
EOF
243254
exit "${1:-1}"
244255
}
@@ -251,6 +262,7 @@ PREFIX=""
251262
option="all"
252263
# default isLocal
253264
isLocal="false"
265+
constantBuildDir="false"
254266
CI="no"
255267

256268
# default values, can be overwritten by cmdline args
@@ -283,6 +295,10 @@ while [ "$#" -gt 0 ]; do
283295
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} $1"
284296
PREFIX=${1#*=}
285297
;;
298+
-constant-build-dir)
299+
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} $1"
300+
constantBuildDir="true"
301+
;;
286302
*)
287303
echo "unknown option: ${1}" >&2
288304
_help

0 commit comments

Comments
 (0)