]> arthur.barton.de Git - bup.git/commitdiff
Adds a testcase for import-rsnapshot.
authorZoran Zaric <zz@zoranzaric.de>
Mon, 6 Dec 2010 12:00:10 +0000 (13:00 +0100)
committerAvery Pennarun <apenwarr@gmail.com>
Mon, 3 Jan 2011 04:57:31 +0000 (20:57 -0800)
Also makes import-rsnapshot use $BUP_MAIN_EXE if available.

Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
cmd/import-rsnapshot-cmd.sh
t/test.sh

index e828f5b68fccc3b10064a53de0524b8a4a1176cb..94db5c1390eec484519a68b65572b4773c6a9ddc 100755 (executable)
@@ -10,9 +10,22 @@ usage() {
     exit -1
 }
 
-if [ "$1" == "-n" ] || [ "$1" == "--dry-run" ]; then
-    bup () { echo "bup $@"; }
+if [ "$1" = "-n" -o "$1" = "--dry-run" ]; then
+    bup()
+    {
+        echo bup "$@" >&2
+    }
     shift 1
+elif [ -n "$BUP_MAIN_EXE" ]; then
+    bup()
+    {
+        "$BUP_MAIN_EXE" "$@"
+    }
+else
+    bup()
+    {
+        bup "$@"
+    }
 fi
 
 [ "$#" -eq 1 ] || [ "$#" -eq 2 ] || usage
index 048c5df0618fbbc3abef93b434eb053107f19372..08a4be53c87897d470d8edabc8e9b39fa76f47a0 100755 (executable)
--- a/t/test.sh
+++ b/t/test.sh
@@ -358,3 +358,23 @@ WVPASS bup index -f $INDEXFILE --exclude=$D/c -ux $D
 bup save --strip -n indexfile -f $INDEXFILE $D
 WVPASSEQ "$(bup ls indexfile/latest/)" "a
 b"
+
+WVSTART "import-rsnapshot"
+
+#set -x
+rm -rf "$BUP_DIR"
+WVPASS bup init
+
+D=bupdata.tmp
+rm -rf $D
+mkdir $D
+
+mkdir -p $D/hourly.0/buptest/a
+touch $D/hourly.0/buptest/a/b
+mkdir -p $D/hourly.0/buptest/c/d
+touch $D/hourly.0/buptest/c/d/e
+
+bup import-rsnapshot $D/
+
+WVPASSEQ "$(bup ls buptest/latest/)" "a/
+c/"