summaryrefslogtreecommitdiff
path: root/manage-baserock
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-06-16 17:02:06 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-06-16 17:02:52 +0100
commitd28cf3af108c45101cf254a56334426614521091 (patch)
tree11b092ea0f104fc579ccec73e19a0c7412b785be /manage-baserock
parent352b10b0dcebc1156bcb9b5f79b525be013d87cd (diff)
downloadbaserock-chroot-d28cf3af108c45101cf254a56334426614521091.tar.gz
Give helpful error when URL doesn't exist
It's slightly confusing that this script doesn't parse file:// URLs, but this is an improvement. Previously the error given was: ln: failed to create symbolic link ‘/opt/baserock/chroots/tmp.P46u6ZxYQC/tarball’ -> ‘’: No such file or directory Sorry, could not link foo into place
Diffstat (limited to 'manage-baserock')
-rwxr-xr-xmanage-baserock4
1 files changed, 4 insertions, 0 deletions
diff --git a/manage-baserock b/manage-baserock
index 0ac0aee..b3a8f52 100755
--- a/manage-baserock
+++ b/manage-baserock
@@ -73,6 +73,10 @@ case "${ACTION}" in
trap cleanup 0
if test "x${URL}" = "x${URL##http://}" -a "x${URL}" = "x${URL##https://}"; then
+ if ! test -e ${URL}; then
+ echo "${URL} is neither a HTTP/HTTPS url nor a path to a local file";
+ exit 1;
+ fi
if ! ln -s "$(readlink -e "${URL}")" "${TEMP_BASE}/tarball"; then
echo "Sorry, could not link ${URL} into place";
exit 1;