Skip to content

Commit de2ee07

Browse files
authored
Fix 'source' on scripts in util/ (chapel-lang#26298)
This PR replaces `(dirname $0)` with `(dirname ${BASH_SOURCE[0]})` in most scripts in `util/`. Using `BASH_SOURCE` allows these scripts to be `source`-ed from a bash prompt. The previous `$0` would give an unintended filename, ex. /bin/bash, in this scenario. `BASH_SOURCE` was already used in many scripts in `util/`. This PR also replaces `CWD` with `UTIL_CRON_DIR` in `util/cron/`, addressing part of chapel-lang#25162, in a separate commit. This PR also removes two "No newline at end of file", in yet another separate commit. ### Discussion At first I wanted to exclude those scripts that are unlikely to be `source`-ed, ex. `start_test`. For such scripts this change can be considered unnecessary. I gave up because it was difficult to judge. Also, there is little downside, if any, for making this change even if it is unnecessary. I excluded the following scripts because they requested `sh`, not `bash`, in their `#!` line. I suspect we can switch them to bash and replace $0 with $BASH_SOURCE for consistency. I am leaving this for another time. config/compileline config/llvmVersions printchplenv start_test test/genGraphs test/paratest.chapdl test/sub_test This post includes a good discussion of `$0` vs. `$BASH_SOURCE` : https://stackoverflow.com/questions/35006457/choosing-between-0-and-bash-source ### Correctness testing - BASH_SOURCE This PR makes only two sets of identical edits, as shows by `sort -u commit1.diff`: in the context of `CWD=` (93 files) and in the context of `export CHPL_HOME=` (2 files). I ran `source` on one file in each of the two groups and checked the execution and/or outcome to verify that the modified line executed correctly: ``` util/cron/test-cray-xc-arkouda.bash util/config/run-in-venv-common.bash ``` I also confirmed that the line `CWD=` modified by this PR is identical to that in 50-some other scripts in util/. ### Correctness testing - UTIL_CRON_DIR I examined manually the output of `sort -u commit2.diff` and collated the after-change lines down to: +$UTIL_CRON_DIR/nightly ...... +$UTIL_CRON_DIR/../buildRelease/gen_release $CHPL_VERSION +$UTIL_CRON_DIR/../buildRelease/testRelease +UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd) +WORKSPACE=${WORKSPACE:-$UTIL_CRON_DIR/../..} +cCompiler=`PYTHONPATH=$CHPL_HOME/util/chplenv python3 $UTIL_CRON_DIR/getCompiler.py` +export CHPL_HOME=$(cd $UTIL_CRON_DIR/../.. ; pwd) +source $UTIL_CRON_DIR/...... The placement of UTIL_CRON_DIR in these lines is correct. I also ran `source ...../util/cron/common-arkouda.bash` , which is modified by this commit, and observed correct execution of the UTIL_CRON_DIR line. r: @jabraham17
2 parents fed9210 + a8a848d commit de2ee07

File tree

147 files changed

+512
-513
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+512
-513
lines changed

util/buildRelease/smokeTest

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# This should fail as soon as something goes awry.
88
set -e
99

10-
CWD=$(cd $(dirname $0) ; pwd)
10+
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
1111

1212
MASON=0
1313
DOCS=0

util/config/run-in-venv-common.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
if [ -z "$CHPL_HOME" ]; then
66
# compute the chpl home directory
7-
export CHPL_HOME=$(cd $(dirname $0) ; cd ..; cd ..; pwd)
7+
export CHPL_HOME=$(cd $(dirname ${BASH_SOURCE[0]}) ; cd ..; cd ..; pwd)
88
fi
99

1010
python=$($CHPL_HOME/util/config/find-python.sh)

util/config/run-in-venv-with-python-bindings.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Active the virtual environment (including Python bindings) and run the command supplied
33
# usage: ./run-in-venv-with-python-bindings prog [args]
44

5-
CWD=$(cd $(dirname $0) ; pwd)
5+
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
66

77
CC=$("$CHPL_HOME/util/printchplenv" --value --only CHPL_HOST_CC)
88
PLATFORM=$("$CHPL_HOME/util/printchplenv" --value --only CHPL_HOST_PLATFORM)

util/config/run-in-venv.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Active the virtual environment and run the command supplied
33
# usage: ./run-in-venv prog [args]
44

5-
CWD=$(cd $(dirname $0) ; pwd)
5+
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
66

77
# Perform checks and set up environment variables for virtual env.
88
source $CWD/run-in-venv-common.bash

util/cron/common-arkouda.bash

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Configure environment for arkouda testing
44

5-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
5+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
66

77
COMMON_DIR=/hpcdc/project/chapel
88
if [ ! -d "$COMMON_DIR" ]; then
@@ -13,7 +13,7 @@ fi
1313
export CHPL_TEST_ARKOUDA_PERF=${CHPL_TEST_ARKOUDA_PERF:-true}
1414
export CHPL_TEST_GEN_ARKOUDA_GRAPHS=${CHPL_TEST_GEN_ARKOUDA_GRAPHS:-true}
1515
if [ "${CHPL_TEST_ARKOUDA_PERF}" = "true" ]; then
16-
source $CWD/common-perf.bash
16+
source $UTIL_CRON_DIR/common-perf.bash
1717
ARKOUDA_PERF_DIR=${ARKOUDA_PERF_DIR:-$COMMON_DIR/NightlyPerformance/arkouda}
1818
export CHPL_TEST_PERF_DIR=$ARKOUDA_PERF_DIR/$CHPL_TEST_PERF_CONFIG_NAME
1919
export CHPL_TEST_NUM_TRIALS=3
@@ -61,18 +61,18 @@ function test_release() {
6161
git checkout $currentSha -- $CHPL_HOME/util/test/perf/
6262
git checkout $currentSha -- $CHPL_HOME/util/test/computePerfStats
6363
git checkout $currentSha -- $CHPL_HOME/third-party/chpl-venv/test-requirements.txt
64-
$CWD/nightly -cron ${nightly_args}
64+
$UTIL_CRON_DIR/nightly -cron ${nightly_args}
6565
}
6666

6767
# test against Chapel nightly
6868
function test_nightly() {
6969
export CHPL_TEST_PERF_DESCRIPTION=nightly
7070
export CHPL_TEST_PERF_CONFIGS="release:v,nightly:v"
71-
$CWD/nightly -cron ${nightly_args}
71+
$UTIL_CRON_DIR/nightly -cron ${nightly_args}
7272
}
7373

7474
function test_correctness() {
75-
$CWD/nightly -cron ${nightly_args}
75+
$UTIL_CRON_DIR/nightly -cron ${nightly_args}
7676
}
7777

7878
function sync_graphs() {

util/cron/common-asan.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Configure environment for testing AddressSanitizer.
44

5-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
5+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
66

77
export CHPL_MEM=cstdlib
88
export CHPL_HOST_MEM=cstdlib

util/cron/common-c-backend.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Configure environment for testing C backends
44

5-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
5+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
66

77
# Do not set CHPL_LLVM=none here for all c-backend testing.
88
# Generally speaking, we would like for tests of the C backend

util/cron/common-champs.bash

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Configure environment for CHAMPS testing
44

55

6-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
6+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
77
COMMON_DIR=/cy/users/chapelu
88

99
export CHAMPS_COMMON_DIR=$COMMON_DIR/champs-nightly
@@ -23,7 +23,7 @@ module list
2323

2424
module purge
2525

26-
source $CWD/common-perf-hpe-apollo-hdr.bash
26+
source $UTIL_CRON_DIR/common-perf-hpe-apollo-hdr.bash
2727

2828
module list
2929

@@ -41,12 +41,12 @@ module list
4141
export CHPL_HOST_PLATFORM=hpe-apollo
4242
export CHPL_TEST_LAUNCHCMD=\$CHPL_HOME/util/test/chpl_launchcmd.py
4343
export CHPL_LAUNCHER_TIMEOUT=pbs
44-
source $CWD/load-base-deps.bash
44+
source $UTIL_CRON_DIR/load-base-deps.bash
4545

4646
module list
4747

4848
# Perf configuration
49-
source $CWD/common-perf.bash
49+
source $UTIL_CRON_DIR/common-perf.bash
5050
CHAMPS_PERF_DIR=${CHAMPS_PERF_DIR:-$COMMON_DIR/NightlyPerformance/champs}
5151
export CHPL_TEST_PERF_CONFIG_NAME='16-node-apollo-hdr'
5252
export CHPL_TEST_PERF_DIR=$CHAMPS_PERF_DIR/$CHPL_TEST_PERF_CONFIG_NAME

util/cron/common-cray-cs.bash

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Cray CS system, otherwise silent
66
# output: iff this seems to be a CS, CHPL_HOST_PLATFORM=cray-cs
77

8-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
8+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
99

1010
function loadCSModule()
1111
{
@@ -24,7 +24,7 @@ if module avail craype- 2>&1 | grep -q craype- ; then
2424
# that wipes out. In the future this should unload only the unwanted modules,
2525
# making re-loading necessary.
2626
module purge
27-
source $CWD/load-base-deps.bash
27+
source $UTIL_CRON_DIR/load-base-deps.bash
2828

2929
loadCSModule gcc/8.1.0
3030
loadCSModule cray-fftw

util/cron/common-gasnet.bash

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# Configure environment for GASNet testing. This should be sourced by other
44
# scripts that wish to make use of the variables set here.
55

6-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
6+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
77

8-
source $CWD/common.bash
9-
source $CWD/common-oversubscribed.bash
8+
source $UTIL_CRON_DIR/common.bash
9+
source $UTIL_CRON_DIR/common-oversubscribed.bash
1010

1111
export CHPL_COMM=gasnet
1212
export GASNET_SPAWNFN=L

util/cron/common-hpe-apollo.bash

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
#
33
# Configure environment for a HPE Apollo system.
44

5-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
5+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
66

77
export CHPL_HOST_PLATFORM=hpe-apollo
88
export CHPL_TEST_LAUNCHCMD=\$CHPL_HOME/util/test/chpl_launchcmd.py
99
export CHPL_LAUNCHER_TIMEOUT=pbs
1010

1111
module purge
12-
source $CWD/load-base-deps.bash
12+
source $UTIL_CRON_DIR/load-base-deps.bash
1313
module load gcc

util/cron/common-hpe-cray-ex.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
3+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
44

55
module unload $(module --terse list 2>&1 | grep PrgEnv-)
66

util/cron/common-llvm.bash

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
# Setup environment for LLVM testing.
44
#
55
# We examine the first commandline parameter,
6-
# $ source $CWD/common-llvm.bash system # $1 is "system", for example
6+
# $ source $UTIL_CRON_DIR/common-llvm.bash system # $1 is "system", for example
77
# if $1 is "bundled" or "system", we set CHPL_LLVM = $1
88
# all other cases, we set CHPL_LLVM = "bundled" for backward-compatibility
99

10-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
10+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
1111

1212
# set CHPL_LLVM = "bundled" or "system", based on $1 if any
1313
# (default CHPL_LLVM = "bundled", and CHPL_LLVM = "none" is not allowed)

util/cron/common-mpicc.bash

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#
33
# Configure environment for MPI module testing on linux64
44

5-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
6-
source $CWD/common.bash
5+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
6+
source $UTIL_CRON_DIR/common.bash
77

88
# Currently, only fifo supported for MPI module
99
export CHPL_TASKS=fifo

util/cron/common-native-gpu.bash

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
1+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
22

3-
source $CWD/common.bash
3+
source $UTIL_CRON_DIR/common.bash
44

55
# Use latest system LLVM, to use an earlier version uncomment and pass version
66
# number as a parameter to the script.

util/cron/common-ofi.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Configure environment for CHPL_COMM=ofi testing.
44

55
if [[ $($CHPL_HOME/util/chplenv/chpl_platform.py --target) != *cray-* ]] ; then
6-
source $CWD/common-oversubscribed.bash
6+
source $UTIL_CRON_DIR/common-oversubscribed.bash
77
fi
88

99
export CHPL_COMM=ofi

util/cron/common-perf.bash

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# Configure environment for performance testing. This should be sourced by other
44
# scripts that wish to make use of the variables set here.
55

6-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
7-
source $CWD/common.bash
8-
source $CWD/common-fast.bash
6+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
7+
source $UTIL_CRON_DIR/common.bash
8+
source $UTIL_CRON_DIR/common-fast.bash
99

1010
# It is tempting to use hostname --short, but macs only support the short form
1111
# of the argument.

util/cron/common-qthreads.bash

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
# Configure environment for qthreads testing. This should be sourced by other
44
# scripts that wish to make use of the variables set here.
55

6-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
6+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
77

88
comm=$($CHPL_HOME/util/chplenv/chpl_comm.py)
99
if [ "${comm}" != "none" ] ; then
10-
source $CWD/common-oversubscribed.bash
10+
source $UTIL_CRON_DIR/common-oversubscribed.bash
1111
fi
1212

1313
export CHPL_TASKS=qthreads

util/cron/common-quickstart.bash

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# Configure environment for quickstart testing. This should be sourced by other
44
# scripts that wish to make use of the variables set here.
55

6-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
7-
source $CWD/common.bash
6+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
7+
source $UTIL_CRON_DIR/common.bash
88
source ${CHPL_HOME}/util/quickstart/setchplenv.bash
99

1010
# Skip $CHPL_HOME/test/regex/elliot/I-fail-without-re2

util/cron/common-tarball.bash

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env bash
22
#
3-
source $CWD/common.bash
3+
source $UTIL_CRON_DIR/common.bash
44

5-
export CHPL_HOME=$(cd $CWD/../.. ; pwd)
5+
export CHPL_HOME=$(cd $UTIL_CRON_DIR/../.. ; pwd)
66
log_info "Setting CHPL_HOME to: ${CHPL_HOME}"
77

88
# Load functions for getting version information from the source tree

util/cron/common-valgrind.bash

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
#
33
# Configure environment for testing valgrind.
44

5-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
5+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
66

77
# qthreads doesn't work with valgrind, so use fifo and limit running threads to
88
# stay below valgrind's --max-threads option, which defaults to 500
9-
source $CWD/common-fifo.bash
9+
source $UTIL_CRON_DIR/common-fifo.bash
1010
export CHPL_RT_NUM_THREADS_PER_LOCALE=450
1111
export CHPL_RT_NUM_THREADS_PER_LOCALE_QUIET=yes
1212

util/cron/common-whitebox.bash

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
#
1616
# The default is cray-xc
1717

18-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
19-
source $CWD/functions.bash
18+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
19+
source $UTIL_CRON_DIR/functions.bash
2020

2121
# Ensure module commands are available.
2222
local_bashrc=/etc/bash.bashrc.local
@@ -116,7 +116,7 @@ module unload cray-mpich
116116
log_info "Unloading atp module"
117117
module unload atp
118118

119-
export CHPL_HOME=$(cd $CWD/../.. ; pwd)
119+
export CHPL_HOME=$(cd $UTIL_CRON_DIR/../.. ; pwd)
120120

121121
# Set CHPL_HOST_COMPILER.
122122
if [ -n "${chpl_host_value}" ] ; then

util/cron/common.bash

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# This should be sourced by other scripts that wish to make use of the
44
# variables set here.
55

6-
CWD=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
7-
source $CWD/functions.bash
6+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
7+
source $UTIL_CRON_DIR/functions.bash
88

9-
source $CWD/load-base-deps.bash
9+
source $UTIL_CRON_DIR/load-base-deps.bash
1010

1111
log_info "gcc version: $(which gcc)"
1212
gcc --version
@@ -63,7 +63,7 @@ function with_logging()
6363
if [ "${CHPL_HOME+x}" = "x" ] ; then
6464
log_info "CHPL_HOME is already set to: ${CHPL_HOME}"
6565
else
66-
export CHPL_HOME=$(cd $CWD/../.. ; pwd)
66+
export CHPL_HOME=$(cd $UTIL_CRON_DIR/../.. ; pwd)
6767
log_info "CHPL_HOME is not set. Defaulting to: ${CHPL_HOME}"
6868
fi
6969
log_info "CHPL_HOME is: ${CHPL_HOME}"

util/cron/create_release_aptrpm.bash

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ if [ -z "$DOCKER_DIR_NAME" ]; then echo "DOCKER_DIR_NAME must be set."; exit 1;
2424
PARALLEL=${PARALLEL:-1}
2525

2626

27-
CWD=$(cd $(dirname $0) ; pwd)
28-
source $CWD/common.bash
29-
source $CWD/functions.bash
27+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
28+
source $UTIL_CRON_DIR/common.bash
29+
source $UTIL_CRON_DIR/functions.bash
3030

31-
export CHPL_HOME=$(cd $CWD/../.. ; pwd)
31+
export CHPL_HOME=$(cd $UTIL_CRON_DIR/../.. ; pwd)
3232
log_info "Setting CHPL_HOME to: ${CHPL_HOME}"
3333

3434
# if any errors occur, this script should fail

util/cron/create_release_tarball.bash

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
# TARBALL_DIR can optionally be set in the environment. If set, the tarball
99
# will be copied to that directory after it is built.
1010

11-
CWD=$(cd $(dirname $0) ; pwd)
12-
source $CWD/common.bash
13-
source $CWD/functions.bash
11+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
12+
source $UTIL_CRON_DIR/common.bash
13+
source $UTIL_CRON_DIR/functions.bash
1414

1515
if [ "${CHPL_VERSION+x}" != "x" ] ; then
1616
log_error "CHPL_VERSION must be set in the environment."
@@ -23,7 +23,7 @@ else
2323
no_tarball_dir=true
2424
fi
2525

26-
export CHPL_HOME=$(cd $CWD/../.. ; pwd)
26+
export CHPL_HOME=$(cd $UTIL_CRON_DIR/../.. ; pwd)
2727
log_info "Setting CHPL_HOME to: ${CHPL_HOME}"
2828

2929
# Allow caller to tell this script to detect the current version based on the
@@ -51,7 +51,7 @@ log_info "Using release branch: ${CHPL_GEN_RELEASE_BRANCH}"
5151

5252
tarball_output="${CHPL_HOME}/tar/chapel-${CHPL_VERSION}.tar.gz"
5353

54-
$CWD/../buildRelease/gen_release $CHPL_VERSION
54+
$UTIL_CRON_DIR/../buildRelease/gen_release $CHPL_VERSION
5555

5656
if [ "${no_tarball_dir}" != "true" ] ; then
5757
expected_loc="${TARBALL_DIR}/$(basename ${tarball_output})"

util/cron/create_tarball.bash

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
#
66
# The tarball is left in root of repo in tar/ directory.
77

8-
CWD=$(cd $(dirname $0) ; pwd)
8+
UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)
99

10-
source $CWD/common-tarball.bash
10+
source $UTIL_CRON_DIR/common-tarball.bash
1111

1212
# Tell gen_release to use existing repo instead of creating a new one with
1313
# git-archive.
1414
export CHPL_GEN_RELEASE_NO_CLONE=true
1515

16-
export CHPL_HOME=$(cd $CWD/../.. ; pwd)
16+
export CHPL_HOME=$(cd $UTIL_CRON_DIR/../.. ; pwd)
1717
log_info "Setting CHPL_HOME to: ${CHPL_HOME}"
1818

1919
export CHPL_LLVM=none

0 commit comments

Comments
 (0)