Skip to content

Commit a12a9aa

Browse files
portantewebbnh
andauthored
Fix stand-alone use of pbench-make-result-tb (#2404)
* Fix stand-alone use of `pbench-make-result-tb` Fixes #2360. * Avoid path problems in target for make-result-tb Co-authored-by: Webb Scales <[email protected]>
1 parent 2d9fb23 commit a12a9aa

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

agent/util-scripts/pbench-make-result-tb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,14 @@ if [[ ! -d "${target_dir}" ]]; then
102102
exit 1
103103
fi
104104

105-
controller_dir="$(basename -- "${target_dir}")"
105+
controller_dir=$(basename -- "${target_dir}")
106+
full_result_dir=$(realpath -e "${result_dir}")
107+
full_target_dir=$(realpath -e "${target_dir}")
106108

107109
# We can now start building the target tarball
108110

109111
# Move into pbench run collection directory
110-
full_result_dir=$(realpath -e ${result_dir})
111-
pushd $(dirname full_result_dir) > /dev/null 2>&1
112+
cd $(dirname ${full_result_dir}) > /dev/null
112113
if [[ ${?} -ne 0 ]]; then
113114
exit 1
114115
fi
@@ -177,7 +178,7 @@ printf -- "%s" "$result_size" | pbench-add-metalog-option ${mdlog} run raw_size
177178
ts=$(timestamp)
178179
printf -- "%s" "$ts" | pbench-add-metalog-option ${mdlog} pbench tar-ball-creation-timestamp
179180

180-
tarball="${target_dir}/${pbench_run_name}.tar.xz"
181+
tarball="${full_target_dir}/${pbench_run_name}.tar.xz"
181182
if [[ "${xz_single_threaded}" == "1" ]]; then
182183
tar_cmd="tar --create --force-local -xz \"${pbench_run_name}\""
183184
else
@@ -191,10 +192,10 @@ if [[ $? -ne 0 ]]; then
191192
exit 1
192193
fi
193194

194-
tarballmd5="${tarball}.md5.check"
195+
tarballmd5="$(basename "${tarball}.md5.check")"
195196
# We need to calculate the md5 sum in the temp directory
196197
# in order to get the filename right.
197-
pushd $(dirname ${tarball}) > /dev/null 2>&1
198+
cd $(dirname ${tarball}) > /dev/null
198199
md5sum "$(basename ${tarball})" > "${tarballmd5}"
199200
if [[ $? -ne 0 ]]; then
200201
error_log "ERROR: md5sum failed for ${tarball}, skipping"

0 commit comments

Comments
 (0)