From 376f15f81885ca25399e8e26057a73642f279c8a Mon Sep 17 00:00:00 2001 From: belliash Date: Wed, 18 Jan 2012 10:51:59 +0100 Subject: [PATCH] implement generateDigests() --- libraries/filesystem | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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 #-------------------------------------------------------------------------------