]> arthur.barton.de Git - bup.git/commitdiff
Create symlinks in t/configure-sampledata; remove them from git.
authorRob Browning <rlb@defaultvalue.org>
Sat, 9 Mar 2013 20:27:34 +0000 (14:27 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sun, 17 Mar 2013 17:55:23 +0000 (12:55 -0500)
Since git doesn't always handle symlinks the way bup expects (Cygwin),
don't keep them in git, create them via "t/configure-sampledata
--setup".

This also provides a place to handle anything else that falls outside
git's purview that we might want to add.

Integrate configure-sampledata into the makefile clean and all
targets.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Makefile
t/configure-sampledata [new file with mode: 0755]
t/sampledata/b [deleted symlink]
t/sampledata/c [deleted symlink]
t/sampledata/etc [deleted symlink]

index 7bebe7794d43eaa04edf807ab543de59ec694e0e..560a8580c1b2ca9c0701bc0326cfa3f4e19ad960 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,7 @@ endif
 default: all
 
 all: bup Documentation/all
+       t/configure-sampledata --setup
 
 bup: lib/bup/_version.py lib/bup/_helpers$(SOEXT) cmds
 
@@ -78,7 +79,7 @@ lib/bup/_version.py:
 
 runtests: all runtests-python runtests-cmdline
 
-runtests-python:
+runtests-python: all
        $(PYTHON) wvtest.py \
                $(wildcard t/t*.py) \
                $(filter-out lib/bup/t/tmetadata.py,$(wildcard lib/*/t/t*.py))
@@ -165,3 +166,4 @@ clean: Documentation/clean config/clean
          then umount bupmeta.tmp/testfs-limited || true; fi
        rm -rf *.tmp *.tmp.meta t/*.tmp lib/*/*/*.tmp build lib/bup/build lib/bup/t/testfs
        if test -e t/tmp; then rm -r t/tmp; fi
+       t/configure-sampledata --clean
diff --git a/t/configure-sampledata b/t/configure-sampledata
new file mode 100755 (executable)
index 0000000..8029f0d
--- /dev/null
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+set -e -o pipefail
+
+top=$(pwd)
+
+usage()
+{
+    echo 'Usage: t/configure-sampledata [--setup | --clean]'
+}
+
+if test "$#" -ne 1; then
+    usage 1>&2; exit 1
+fi
+
+case "$1" in
+    '--setup')
+        (
+            cd t/sampledata
+            ln -sf a b
+            ln -sf b c
+            ln -sf /etc .
+        )
+        ;;
+    '--clean')
+        (
+            cd t/sampledata
+            if test -e b; then rm b; fi
+            if test -e c; then rm c; fi
+            if test -e etc; then rm etc; fi
+        )
+        ;;
+    *)
+        usage 1>&2; exit 1
+        ;;
+esac
diff --git a/t/sampledata/b b/t/sampledata/b
deleted file mode 120000 (symlink)
index 2e65efe..0000000
+++ /dev/null
@@ -1 +0,0 @@
-a
\ No newline at end of file
diff --git a/t/sampledata/c b/t/sampledata/c
deleted file mode 120000 (symlink)
index 63d8dbd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-b
\ No newline at end of file
diff --git a/t/sampledata/etc b/t/sampledata/etc
deleted file mode 120000 (symlink)
index 34ed534..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/etc
\ No newline at end of file