diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2010-03-30 22:53:01 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-06-26 00:30:19 -0600 |
commit | 1206949c173977283d45bafc9e951a749317b1da (patch) | |
tree | 1308ef0114195e1a58c509cd9cf92219e324b921 /rvs/plugins/filecontent/bin/get.d.sh | |
parent | 6cd61746524c1240d8e181e6e3dda70653cea5b2 (diff) |
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
Diffstat (limited to 'rvs/plugins/filecontent/bin/get.d.sh')
-rw-r--r-- | rvs/plugins/filecontent/bin/get.d.sh | 18 |
1 files changed, 7 insertions, 11 deletions
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" |