1 | #!@SHELL@ |
---|
2 | # @configure_input@ |
---|
3 | |
---|
4 | # $Id: init.sh.in 978 2009-12-12 20:09:41Z peter $ |
---|
5 | |
---|
6 | # Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson |
---|
7 | # Copyright (C) 2009 Peter Johansson |
---|
8 | # |
---|
9 | # This file is part of svndigest, http://dev.thep.lu.se/svndigest |
---|
10 | # |
---|
11 | # svndigest is free software; you can redistribute it and/or modify it |
---|
12 | # under the terms of the GNU General Public License as published by |
---|
13 | # the Free Software Foundation; either version 3 of the License, or |
---|
14 | # (at your option) any later version. |
---|
15 | # |
---|
16 | # svndigest is distributed in the hope that it will be useful, but |
---|
17 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
19 | # General Public License for more details. |
---|
20 | # |
---|
21 | # You should have received a copy of the GNU General Public License |
---|
22 | # along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
---|
23 | |
---|
24 | exit_fail () |
---|
25 | { |
---|
26 | echo "$me: failed test: $@" 1>&2; |
---|
27 | exit 1 |
---|
28 | } |
---|
29 | |
---|
30 | exit_skip () |
---|
31 | { |
---|
32 | echo "$me: skipped test: $@" |
---|
33 | exit 77 |
---|
34 | } |
---|
35 | |
---|
36 | exit_success () |
---|
37 | { |
---|
38 | echo "$me: successsful test: $@"; |
---|
39 | exit 0 |
---|
40 | } |
---|
41 | |
---|
42 | # primary variables - set by config.status |
---|
43 | abs_top_builddir=@abs_top_builddir@ |
---|
44 | abs_builddir=@abs_builddir@ |
---|
45 | mkdir_p="@MKDIR_P@" |
---|
46 | repo="@abs_test_repo@" |
---|
47 | shell=@SHELL@ |
---|
48 | test_repo_found=@test_repo_found@ |
---|
49 | wc_found="@wc_found@" |
---|
50 | |
---|
51 | test -z "$SVNDIGEST" && SVNDIGEST="@top_builddir@/bin/svndigest --verbose"; |
---|
52 | test -z "$srcdir" && srcdir="@srcdir@"; |
---|
53 | test -z "$SVN" && SVN=svn; |
---|
54 | |
---|
55 | # some helpful derived variables |
---|
56 | rootdir=$abs_builddir/toy_project |
---|
57 | targetdir=$abs_builddir/generated_output |
---|
58 | repo_url="file://$repo" |
---|
59 | |
---|
60 | while test $# -gt 0; do |
---|
61 | case "$1" in |
---|
62 | -v) |
---|
63 | VERBOSE=1 |
---|
64 | ;; |
---|
65 | esac |
---|
66 | shift |
---|
67 | done |
---|
68 | |
---|
69 | # redirect output unless in verbose mode |
---|
70 | test -z "$VERBOSE" && exec > /dev/null; |
---|
71 | |
---|
72 | me=$0 |
---|
73 | |
---|
74 | for r in : $required; do |
---|
75 | case $r in |
---|
76 | repo*) |
---|
77 | if test x$test_repo_found = xyes; then |
---|
78 | cd $abs_builddir && $shell svn_update.sh || exit 1; |
---|
79 | else |
---|
80 | exit_skip "no test repository available"; |
---|
81 | fi;; |
---|
82 | wc) |
---|
83 | if test x$wc_found = xno; then |
---|
84 | exit_skip "not subversion working copy"; |
---|
85 | fi;; |
---|
86 | *) |
---|
87 | : |
---|
88 | esac |
---|
89 | done |
---|
90 | |
---|
91 | echo "=== running $me ===" |
---|
92 | |
---|
93 | # turn on trace in verbose mode |
---|
94 | if test -n "$VERBOSE"; then |
---|
95 | set -x; |
---|
96 | fi |
---|
97 | |
---|