summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2009-07-17 00:05:43 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-06-26 00:30:11 -0600
commit582f21486665f202646954f3c37aa9a3d60f61b0 (patch)
tree08a098f6e7feac57b141e2dc47fd64ac610832a3
parentf65a0644e57c6c09f6fe9a8cf496ec497d0d0a27 (diff)
doing a lot better, still not functional
-rw-r--r--src/rvs-core/commit.d.sh4
-rw-r--r--src/rvs-core/commit.sh4
-rw-r--r--src/rvs-core/lib/rvsdb.sh7
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
}