From d28cf3af108c45101cf254a56334426614521091 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Mon, 16 Jun 2014 17:02:06 +0100 Subject: Give helpful error when URL doesn't exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- manage-baserock | 4 ++++ 1 file changed, 4 insertions(+) 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; -- cgit v1.2.1