From 8a3cca551e412d3bd5cfddc6aa73c4f97edb483f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Aug 2009 23:46:36 -0400 Subject: I can now check out from the repo! --- plugins/repo/commit.d.sh | 5 +++-- plugins/repo/get.d.sh | 10 +++++++--- plugins/repo/get.sh | 10 ++++++---- plugins/repo/lib/stdio.sh | 5 +++-- plugins/users/mkuser.sh | 2 ++ rvs.sh | 5 +++-- 6 files changed, 24 insertions(+), 13 deletions(-) diff --git a/plugins/repo/commit.d.sh b/plugins/repo/commit.d.sh index eabdc78..3c6709d 100644 --- a/plugins/repo/commit.d.sh +++ b/plugins/repo/commit.d.sh @@ -13,9 +13,10 @@ ver='0.7.0' # commit.d DIRNAME dir="$1" - tmp=`tempfile` -for file in $dir/*; do + +cd "$dir" +for file in *; do hash=`"$RVSDIR/commit" "$file"` echo "$file:$hash" >> "$tmp" done diff --git a/plugins/repo/get.d.sh b/plugins/repo/get.d.sh index 9ef25b9..9b1b5bc 100644 --- a/plugins/repo/get.d.sh +++ b/plugins/repo/get.d.sh @@ -16,9 +16,13 @@ id="$1" dir="$2" tmp=`tempfile` -"$RVSDIR/get.f" `sed -n 's/^hash://p' "$db"` "$tmp" +"$RVSDIR/get.f" "$id" "$tmp" -mkdir "$dir" +#install -d "$dir" +mkdir -p "$dir" + +cd "$dir" +rm -rf ./* while read line; do # GNU bash optimized version #hash=${line/#*:/} @@ -26,7 +30,7 @@ while read line; do # POSIX version hash=`echo "$line" | sed 's/^.*://'` name=`echo "$line" | sed "s/:$hash$//"` - "$RVSDIR/get" "$dir/$file" + "$RVSDIR/get" "$hash" "$name" done < "$tmp" rm "$tmp" diff --git a/plugins/repo/get.sh b/plugins/repo/get.sh index 5618d0a..fcb602a 100644 --- a/plugins/repo/get.sh +++ b/plugins/repo/get.sh @@ -9,16 +9,18 @@ ver='0.7.0' # # Originally written by Luke Shumaker . -#source "$RVSDIR/lib/stdio" +source "$RVSDIR/lib/stdio" # get ID [FILE] id="$1" - tmp=`tempfile` "$RVSDIR/get.f" "$id" "$tmp" -type=`sed -n 's/^type://p' "$tmp"` +type="`sed -n 's/^type://p' "$tmp"`" file="${2-`sed -n 's/^name://p' "$tmp"`}" +hash="`sed -n 's/^hash://p' "$tmp"`" -"$RVSDIR/get.$type" "$id" "$file" +out "-$type `pwd`/$file:$hash" +"$RVSDIR/get.$type" "$hash" "$file" rm "$tmp" + diff --git a/plugins/repo/lib/stdio.sh b/plugins/repo/lib/stdio.sh index f85b7fa..3207db8 100644 --- a/plugins/repo/lib/stdio.sh +++ b/plugins/repo/lib/stdio.sh @@ -11,18 +11,19 @@ verbose() { if [ "$volume" == '-v' ]; then - echo $@ + echo $@ >> /dev/stderr fi } out() { if [ "$volume" != '-q' ]; then - echo $@ + echo $@ >> /dev/stderr fi } warn () { echo "$name: $1" >> /dev/stderr + echo "$name: $1" >> "$repo/../rvs.log" } fatal () { diff --git a/plugins/users/mkuser.sh b/plugins/users/mkuser.sh index de4aeea..f07235b 100644 --- a/plugins/users/mkuser.sh +++ b/plugins/users/mkuser.sh @@ -10,7 +10,9 @@ ver='0.7.0' # Originally written by Luke Shumaker . read -p 'username: ' author +echo "$author" read -p 'give copyright to: ' owner +echo "$owner" if [ "$owner" != 'Public Domain' ]; then read -p 'use the license: ' license else diff --git a/rvs.sh b/rvs.sh index 2c56eec..b2a3f93 100644 --- a/rvs.sh +++ b/rvs.sh @@ -29,7 +29,7 @@ _repo() { if [ -e "`pwd`/$repo" ]; then echo "`pwd`/$repo" else - _error "no $name repository found" >> /dev/stderr + _error "no $name repository found" fi cd "$owd" } @@ -64,7 +64,8 @@ _install() { else echo "$id" >> "$RVSDIR/plugins" fi - cp -rp "$dir" "$RVSDIR/$id" + rm -rf "$RVSDIR/$id" + cp -rpT "$dir" "$RVSDIR/$id" } _uninstall() { -- cgit v1.1-4-g5e80