]> arthur.barton.de Git - bup.git/blobdiff - t/lib.sh
test-rm: sort compare-trees output with LC_ALL=C
[bup.git] / t / lib.sh
index 372f0d20d5d5983ee0c8428d3a6cdda9473344c3..5c5b01ee5947659b3d687ee11792374ced57371d 100644 (file)
--- a/t/lib.sh
+++ b/t/lib.sh
@@ -1,18 +1,23 @@
 # Assumes shell is Bash, and pipefail is set.
 
-bup_t_lib_script_home=$(cd "$(dirname $0)" && pwd)
+bup_t_lib_script_home=$(cd "$(dirname $0)" && pwd) || exit $?
+
+bup-python()
+{
+    "$bup_t_lib_script_home/../cmd/bup-python" "$@"
+}
 
 force-delete()
 {
     "$bup_t_lib_script_home/force-delete" "$@"
 }
 
-realpath()
+resolve-parent()
 {
     test "$#" -eq 1 || return $?
     echo "$1" | \
-        PYTHONPATH="$bup_t_lib_script_home/../lib" python -c \
-        "import sys, bup.helpers; print bup.helpers.realpath(sys.stdin.readline())" \
+        PYTHONPATH="$bup_t_lib_script_home/../lib" bup-python -c \
+        "import sys, bup.helpers; print bup.helpers.resolve_parent(sys.stdin.readline())" \
         || return $?
 }
 
@@ -46,3 +51,8 @@ path-filesystems()
     done
     exit 0
 )
+
+escape-erx()
+{
+    sed 's/[][\.|$(){?+*^]/\\&/g' <<< "$*"
+}