mkshadow revision 1.1 1 1.1 christos #!/bin/sh
2 1.1 christos #
3 1.1 christos # Simple script to make a "shadow" test directory, using symbolic links.
4 1.1 christos # Typically you'd put the shadow in /tmp or another local disk
5 1.1 christos #
6 1.1 christos # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
7 1.1 christos # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
8 1.1 christos # This file is part of GNU Make.
9 1.1 christos #
10 1.1 christos # GNU Make is free software; you can redistribute it and/or modify it under the
11 1.1 christos # terms of the GNU General Public License as published by the Free Software
12 1.1 christos # Foundation; either version 2, or (at your option) any later version.
13 1.1 christos #
14 1.1 christos # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
15 1.1 christos # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 1.1 christos # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 1.1 christos #
18 1.1 christos # You should have received a copy of the GNU General Public License along with
19 1.1 christos # GNU Make; see the file COPYING. If not, write to the Free Software
20 1.1 christos # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 1.1 christos
22 1.1 christos case "$1" in
23 1.1 christos "") echo 'Usage: mkshadow <destdir>'; exit 1 ;;
24 1.1 christos esac
25 1.1 christos
26 1.1 christos dest="$1"
27 1.1 christos
28 1.1 christos if [ ! -d "$dest" ]; then
29 1.1 christos echo "Destination directory \`$dest' must exist!"
30 1.1 christos exit 1
31 1.1 christos fi
32 1.1 christos
33 1.1 christos if [ ! -f run_make_tests ]; then
34 1.1 christos echo "The current directory doesn't appear to contain the test suite!"
35 1.1 christos exit 1
36 1.1 christos fi
37 1.1 christos
38 1.1 christos suite=`pwd | sed 's%^/tmp_mnt%%'`
39 1.1 christos name=`basename "$suite"`
40 1.1 christos
41 1.1 christos files=`echo *`
42 1.1 christos
43 1.1 christos set -e
44 1.1 christos
45 1.1 christos mkdir "$dest/$name"
46 1.1 christos cd "$dest/$name"
47 1.1 christos
48 1.1 christos ln -s "$suite" .testdir
49 1.1 christos
50 1.1 christos for f in $files; do
51 1.1 christos ln -s .testdir/$f .
52 1.1 christos done
53 1.1 christos
54 1.1 christos rm -rf work
55 1.1 christos
56 1.1 christos echo "Shadow test suite created in \`$dest/$name'."
57 1.1 christos exit 0
58