From cb0470e40d4d12330973cfad4150cbef8076edd1 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz (arab, vxp) Date: Jun 24 2016 10:05:34 +0000 Subject: build.sh -i: refuse to overwrite build script w/ identical filename. Followup to <3243be768ad8a601b2636be4dd23dbb6c2d7dd9b>. --- diff --git a/build.subr b/build.subr index 7858378..f44b5be 100644 --- a/build.subr +++ b/build.subr @@ -89,7 +89,8 @@ insert_build_script_link() { || ! isnumber ${_ibsl_level} \ || [ ${#_ibsl_level} != 3 ]; then log_msg failexit "Error: invalid or empty build script filename/level/name."; - return 1; + elif [ -e ${_ibsl_fname} ]; then + log_msg failexit "Error: build script \`${_ibsl_fname}' already exists."; elif [ -z "$(find -maxdepth 1 -name ${_ibsl_level}.\* -printf '%P\n' -quit)" ]; then echo ln -s pkg.build ${_ibsl_fname}; ln -s pkg.build ${_ibsl_fname};