From 1d133ecb0a5f83f2284a7733050f760b3260a14d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 3 Mar 2011 15:42:09 +0100 Subject: [PATCH] fix type __file: md5sum from stdin (=same name) and prepend / to object_id Signed-off-by: Nico Schottelius --- conf/type/__file/explorer/md5sum | 6 +++--- conf/type/__file/gencode | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/type/__file/explorer/md5sum b/conf/type/__file/explorer/md5sum index f755c769..a8ce6152 100755 --- a/conf/type/__file/explorer/md5sum +++ b/conf/type/__file/explorer/md5sum @@ -24,12 +24,12 @@ if [ -f "$__object/parameter/destination" ]; then destination="$(cat "$__object/parameter/destination")" else - destination="$__object_id" + destination="/$__object_id" fi # No output if file does not exist - does definitely not match the md5sum :-) if [ -e "$destination" ]; then - md5sum "$destination" + md5sum < "$destination" else - echo "NO FILE NOT FOUND, NO CHECKSUM CALCULATED." + echo "NO FILE FOUND, NO CHECKSUM CALCULATED." fi diff --git a/conf/type/__file/gencode b/conf/type/__file/gencode index e0398877..0d2c8478 100755 --- a/conf/type/__file/gencode +++ b/conf/type/__file/gencode @@ -49,7 +49,7 @@ if [ -f "$__object/parameter/source" ]; then exec 1>&2 set -x - md5sum="$(md5sum "$source")" + md5sum="$(md5sum < "$source")" remote_md5sum="$(cat "$__object/explorer/md5sum")" # Is md5sum the right approach?