|
Packit |
b099d7 |
#!/bin/csh
|
|
Packit |
b099d7 |
# Motif
|
|
Packit |
b099d7 |
#
|
|
Packit |
b099d7 |
# Copyright (c) 1987-2012, The Open Group. All rights reserved.
|
|
Packit |
b099d7 |
#
|
|
Packit |
b099d7 |
# These libraries and programs are free software; you can
|
|
Packit |
b099d7 |
# redistribute them and/or modify them under the terms of the GNU
|
|
Packit |
b099d7 |
# Lesser General Public License as published by the Free Software
|
|
Packit |
b099d7 |
# Foundation; either version 2 of the License, or (at your option)
|
|
Packit |
b099d7 |
# any later version.
|
|
Packit |
b099d7 |
#
|
|
Packit |
b099d7 |
# These libraries and programs are distributed in the hope that
|
|
Packit |
b099d7 |
# they will be useful, but WITHOUT ANY WARRANTY; without even the
|
|
Packit |
b099d7 |
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
Packit |
b099d7 |
# PURPOSE. See the GNU Lesser General Public License for more
|
|
Packit |
b099d7 |
# details.
|
|
Packit |
b099d7 |
#
|
|
Packit |
b099d7 |
# You should have received a copy of the GNU Lesser General Public
|
|
Packit |
b099d7 |
# License along with these librararies and programs; if not, write
|
|
Packit |
b099d7 |
# to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
|
|
Packit |
b099d7 |
# Floor, Boston, MA 02110-1301 USA
|
|
Packit |
b099d7 |
#
|
|
Packit |
b099d7 |
# HISTORY
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#the second argument is the directory we're working on
|
|
Packit |
b099d7 |
# all arguments that follow are defines. This version does
|
|
Packit |
b099d7 |
# not use the defines.
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
if ($#argv == 0) then
|
|
Packit |
b099d7 |
echo "Error: no CURRENT_DIR passed to Genrun"
|
|
Packit |
b099d7 |
echo "Please check Imakefile"
|
|
Packit |
b099d7 |
exit 1
|
|
Packit |
b099d7 |
else
|
|
Packit |
b099d7 |
set current_dir = $argv[1]
|
|
Packit |
b099d7 |
set top = $argv[2]
|
|
Packit |
b099d7 |
endif
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#other files we use
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
set dirsAutoFile = "$top/./tests/General/dirsAuto"
|
|
Packit |
b099d7 |
set runCustomFile = "./RUN.custom"
|
|
Packit |
b099d7 |
set runTemplate = "$top/./tests/General/RUN_template"
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#if these files are missing, issue message and bail out now
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
if !(-e $dirsAutoFile) then
|
|
Packit |
b099d7 |
echo $dirsAutoFile " is missing, cannot continue"
|
|
Packit |
b099d7 |
exit 1
|
|
Packit |
b099d7 |
endif
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
if !(-e $runTemplate) then
|
|
Packit |
b099d7 |
echo $runTemplate " is missing, cannot continue"
|
|
Packit |
b099d7 |
exit 1
|
|
Packit |
b099d7 |
endif
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#preclean
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
if (-e RUN) then
|
|
Packit |
b099d7 |
rm -f RUN.bak
|
|
Packit |
b099d7 |
mv RUN RUN.bak
|
|
Packit |
b099d7 |
endif
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#go for it
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
set is_automated = `grep -c $current_dir $dirsAutoFile`
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
if ($is_automated) then
|
|
Packit |
b099d7 |
# first check for the runCustomFile
|
|
Packit |
b099d7 |
if !(-e $runCustomFile) then
|
|
Packit |
b099d7 |
echo $runCustomFile " in " $current_dir "is missing"
|
|
Packit |
b099d7 |
echo "Cannot continue"
|
|
Packit |
b099d7 |
exit 1
|
|
Packit |
b099d7 |
endif
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
sed -e '/<Customize>/r ./RUN.custom' -e '/<Customize>/d' \
|
|
Packit |
b099d7 |
$runTemplate > RUN
|
|
Packit |
b099d7 |
chmod +x RUN
|
|
Packit |
b099d7 |
else
|
|
Packit |
b099d7 |
# this directory isn't an automated one
|
|
Packit |
b099d7 |
echo "Not an automated directory"
|
|
Packit |
b099d7 |
# because this rule ends up EVERYWHERE, do nothing if not
|
|
Packit |
b099d7 |
# automated
|
|
Packit |
b099d7 |
# *** old code ***
|
|
Packit |
b099d7 |
# echo "Using fcopy to get latest version of this RUN script"
|
|
Packit |
b099d7 |
# we'll do this eventually
|
|
Packit |
b099d7 |
# fcopy -x $current_dir/RUN
|
|
Packit |
b099d7 |
# but until the bug with -x is fixed, we'll do the following
|
|
Packit |
b099d7 |
# this will not work correctly for directories which clash with
|
|
Packit |
b099d7 |
# Performance directories:
|
|
Packit |
b099d7 |
# tests/Toolkit/Text
|
|
Packit |
b099d7 |
# tests/Toolkit/Traversal
|
|
Packit |
b099d7 |
# fcopy $current_dir/RUN <
|
|
Packit |
b099d7 |
#y
|
|
Packit |
b099d7 |
#!
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
endif
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
|