[gtksourceview/wip/loader-saver: 27/42] Add setup-file-saver.sh script



commit c8c05bd8c2cbbafbe39f07795f035461e5a8e9a7
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 5d52121..4a2a481 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -185,6 +185,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]