From 1206949c173977283d45bafc9e951a749317b1da Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 30 Mar 2010 22:53:01 -0600 Subject: so, I realised that because: * filedata was stipped down to just filename * the directory structure of files/filecontent stored member names then: * all filedata was really doing is storing filetype so, I decided to make filetype inherent of ID in a fairly elegant way --- rvs/plugins/filecontent/bin/get.d.sh | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'rvs/plugins/filecontent/bin/get.d.sh') diff --git a/rvs/plugins/filecontent/bin/get.d.sh b/rvs/plugins/filecontent/bin/get.d.sh index 1723d8a..1a001d3 100644 --- a/rvs/plugins/filecontent/bin/get.d.sh +++ b/rvs/plugins/filecontent/bin/get.d.sh @@ -19,12 +19,12 @@ ver=0.9 #. "$LIBDIR/@ID@/stdio" -# get.d ID DIRNAME -id="$1" -dir="$2" +usage="usage: $RVS get.d DIRNAME ID" +dir="${1?"$usage"}" + id="${2?"$usage"}" tmp=`mktemp` -"$RVS" get.f "$id" "$tmp" +"$RVS" get.f "$tmp" "$id" #install -d "$dir" mkdir -p "$dir" @@ -32,13 +32,9 @@ mkdir -p "$dir" cd "$dir" rm -rf ./* while read line; do - # GNU bash optimized version - #hash=${line/#*:/} - #name=${line/%:${hash}/} - # POSIX version - hash=`echo "$line" | sed 's/^.*://'` - name=`echo "$line" | sed "s/:$hash$//"` - "$RVS" get "$hash" "$name" + _id="`echo "$line" | sed 's/^.*://'`" + _name="`echo "$line" | sed 's@:'"$_id"'$@@'`" + "$RVS" get "$_name" "$_id" done < "$tmp" rm "$tmp" -- cgit v1.2.3