[gtksourceview/wip/loader-saver: 31/34] Add setup-file-saver.sh script



commit 81d44cff800cee10f3b002b87a24fb29ae4dbf0d
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Mon Jan 6 16:54:32 2014 +0100

    Add setup-file-saver.sh script

 tests/Makefile.am         |    1 +
 tests/setup-file-saver.sh |   27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8412d49..a6f4ff3 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -179,6 +179,7 @@ TESTS = $(UNIT_TEST_PROGS)
 EXTRA_DIST =                           \
        language-specs/test-empty.lang  \
        language-specs/test-full.lang   \
+       setup-file-saver.sh             \
        styles/classic.xml              \
        test-completion.gresource.xml   \
        test-completion.ui              \
diff --git a/tests/setup-file-saver.sh b/tests/setup-file-saver.sh
new file mode 100755
index 0000000..f900175
--- /dev/null
+++ b/tests/setup-file-saver.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# This script is used to setup some special directory structures, permissions
+# for the file saver test.
+
+UNOWNED_DIRECTORY="/tmp/gtksourceview-file-saver-unowned"
+UNOWNED_FILE="/tmp/gtksourceview-file-saver-unowned/gtksourceview-file-saver-test.txt"
+
+UNOWNED_GROUP="/tmp/gtksourceview-file-saver-unowned-group.txt"
+
+if [ -f "$UNOWNED_FILE" ]; then
+       sudo rm "$UNOWNED_FILE"
+fi
+
+if [ -d "$UNOWNED_DIRECTORY" ]; then
+       sudo rmdir "$UNOWNED_DIRECTORY"
+fi
+
+mkdir "$UNOWNED_DIRECTORY"
+touch "$UNOWNED_FILE"
+
+sudo chown nobody "$UNOWNED_DIRECTORY"
+
+sudo touch "$UNOWNED_GROUP"
+sudo chgrp root "$UNOWNED_GROUP"
+sudo chmod u+w,g+w,o-rwx "$UNOWNED_GROUP"
+sudo chown $USER "$UNOWNED_GROUP"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]