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