From ee8ee6381c004f9d5a22b615a51c40f9547be390 Mon Sep 17 00:00:00 2001 From: George Danchev Date: Sat, 21 Apr 2012 16:17:30 +0000 Subject: [PATCH] check for existance of the file(1) utility; might not be found in lean chroots --- releng/auto_isocontent | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/releng/auto_isocontent b/releng/auto_isocontent index af1f4c62..b708d40a 100755 --- a/releng/auto_isocontent +++ b/releng/auto_isocontent @@ -81,10 +81,17 @@ ln "$on_disk"/file_2 "$on_disk"/file_2_link_a || exit 1 # trivial ISO 9660 image validation routine is_valid_iso9660() { ISOfile="$1" + if ! which file >/dev/null 2>&1; then + printf "\nFAIL : ${SELF}: Not found: file. Please install the file(1) utility.\n" + failure=1 + return + fi if [ ! -f ${ISOfile} ]; then failure=1 printf "\nFAIL : ${SELF} : Not found: ${ISOfile}\n" + return fi + file ${ISOfile} if file ${ISOfile} | grep "ISO *9660" >/dev/null 2>&1; then printf "\n${SELF}: Resulting ${ISOfile} OK. Looks like ISO 9660 filesystem.\n"