diff --git a/libraries/filesystem b/libraries/filesystem index e5d06ca..1ae7c49 100644 --- a/libraries/filesystem +++ b/libraries/filesystem @@ -63,6 +63,26 @@ function download() { return ${RESULT} } +#------------------------------------------------------------------------------- +# Generates a hash file +# Parameters: %digestfile% %filelist% +#------------------------------------------------------------------------------- +function generateDigests() { + if [ "${DIGESTS}" != "" ]; then + local OUTPUT="${1}" + shift + local FILELIST="${@}" + rm -f ${OUTPUT} + for FILE in ${FILELIST}; do + [ ! -f ${FILE} ] && return 1 + for DIGEST in ${DIGESTS}; do + shash -a ${DIGEST} ${FILE} >> ${OUTPUT} + done + done + fi + return 0 +} + #------------------------------------------------------------------------------- # Creates all 'core' directories necessary for EzBuild to operate #-------------------------------------------------------------------------------