cmd-fetch: fix handling relative --write-lockfile-to paths
And while we're here, also delete the `sleep 1` and printing the
lockfile for the same reasons as the previous commit.
@@ -73,12 +73,8 @@ else
for lock in "${manifest_lock}" "${manifest_lock_overrides}"; do
if [ -f "${lock}" ]; then
args+=" --ex-lockfile=${lock}"
- echo "Fetching RPMs from lockfile: ${lock}"
fi
done
- if [ -n "${args}" ]; then
- sleep 1
- fi
fi
if [ -n "${DRY_RUN}" ]; then
@@ -91,13 +87,9 @@ runcompose --download-only ${args}
if [ -n "${UPDATE_LOCKFILE}" ]; then
# Write out to the lockfile specified by the user or to the
# existing manifest lockfile if none was specified by the user
- if [ -n "${OUTPUT_LOCKFILE}" ]; then
- # assume given path is relative to toplevel workdir
- outfile="${workdir}/${OUTPUT_LOCKFILE}"
- else
- outfile=$manifest_lock
- fi
+ outfile=${OUTPUT_LOCKFILE:-${manifest_lock}}
strip_out_lockfile_digests "${tmprepo}/tmp/manifest-lock.json"
- mv -f "${tmprepo}/tmp/manifest-lock.json" "${outfile}"
+ # cd back to workdir in case OUTPUT_LOCKFILE is relative
+ (cd "${workdir}" && mv -f "${tmprepo}/tmp/manifest-lock.json" "${outfile}")
echo "Wrote out lockfile ${outfile}"
fi
