Skip to content

Commit

Permalink
Fix stand-alone use of pbench-make-result-tb (#2404)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
portante and webbnh authored Aug 6, 2021
1 parent 2d9fb23 commit a12a9aa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions agent/util-scripts/pbench-make-result-tb
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,14 @@ if [[ ! -d "${target_dir}" ]]; then
exit 1
fi

controller_dir="$(basename -- "${target_dir}")"
controller_dir=$(basename -- "${target_dir}")
full_result_dir=$(realpath -e "${result_dir}")
full_target_dir=$(realpath -e "${target_dir}")

# We can now start building the target tarball

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

tarball="${target_dir}/${pbench_run_name}.tar.xz"
tarball="${full_target_dir}/${pbench_run_name}.tar.xz"
if [[ "${xz_single_threaded}" == "1" ]]; then
tar_cmd="tar --create --force-local -xz \"${pbench_run_name}\""
else
Expand All @@ -191,10 +192,10 @@ if [[ $? -ne 0 ]]; then
exit 1
fi

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

0 comments on commit a12a9aa

Please sign in to comment.