From 582f21486665f202646954f3c37aa9a3d60f61b0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 17 Jul 2009 00:05:43 -0400 Subject: doing a lot better, still not functional --- src/rvs-core/commit.d.sh | 4 ++-- src/rvs-core/commit.sh | 4 ++-- src/rvs-core/lib/rvsdb.sh | 7 +++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/rvs-core/commit.d.sh b/src/rvs-core/commit.d.sh index 5a47614..dcad82f 100644 --- a/src/rvs-core/commit.d.sh +++ b/src/rvs-core/commit.d.sh @@ -19,8 +19,8 @@ dir="$1" tmp=`tempfile` loginit "$tmp" -for file in $dir; do - hash=`commit "$dir/$file"` +for file in $dir/*; do + hash=`rvs commit "$dir/$file"` echo "$file:$hash" >> "$tmp" done diff --git a/src/rvs-core/commit.sh b/src/rvs-core/commit.sh index 189c8b9..7fe1221 100644 --- a/src/rvs-core/commit.sh +++ b/src/rvs-core/commit.sh @@ -21,9 +21,9 @@ else file='.' fi -if [ ! -e $file]; then error "file \`$file' does not exist"; +if [ ! -e $file ]; then error "file \`$file' does not exist"; # START file type list -elif [ -l $file ]; then type='l'; # symbolic link +elif [ -L $file ]; then type='l'; # symbolic link elif [ -b $file ]; then type='b'; # block (buffered) special elif [ -c $file ]; then type='c'; # character (unbuffered) special elif [ -d $file ]; then type='d'; # directory diff --git a/src/rvs-core/lib/rvsdb.sh b/src/rvs-core/lib/rvsdb.sh index 3ced573..a02304b 100644 --- a/src/rvs-core/lib/rvsdb.sh +++ b/src/rvs-core/lib/rvsdb.sh @@ -62,12 +62,15 @@ logwrite() { #lines=`_find "$log" '1' "$var"` #if [ "$lines" = '' ]; then - if [ `lograw "$log" | grep "^$var:"` = '' ]; then + if [ "`lograw "$log" | grep "^$var:"`" == '' ]; then # no exiswhereting occurances echo "$var:$val" >> "$log" else # found others - sed -i "^s/$var:.*/$var:$val/" "$log" + # escape slashes + var=`echo "$var" | sed 's:/:\\\\/:g'` + val=`echo "$val" | sed 's:/:\\\\/:g'` + sed -i "s/^$var:.*$/$var:$val/" "$log" #lograw "$log" | ?????? fi } -- cgit v1.2.3