#!/bin/bash # $HeadURL$ $LastChangedRevision$ PROGNAME=${0##*/} SANDPIT=$(pwd) . $(ade-config ade_share_prefix)/include/adetestsupport.sh ############################################################################## # # Purpose of test: to verify that adeinst functions correctly in 'mode two' # which is: # # adeinst ... # ############################################################################## echo "creating base directories ..." mkdir $SANDPIT/src $SANDPIT/dst $SANDPIT/dst/experiment1 $SANDPIT/dst/experiment2 echo "creating some source files ..." # More than ten files are needed; to see why simply run 'echo $13' at the # Unix prompt! for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23; do # since we can't use 'mkfad' to verify the output, we'll use 'ls'. # since 'ls' will only tell us the size, then lets make the 'ls -l' # info good enough to verify that the files are correctly named by # making ... err ... "their contents proportional to their names." j=0 while [ ${j} -lt ${i} ]; do echo j=$(expr ${j} + 1) done > $SANDPIT/src/src${i} # Fri Dec 26 11:27:44 CET 2008 - Alexis Huxley # Previously adeinst always set the perms on the destination file # to be executable, but that behaviour has changed; now the # destination modes depend on the source's perms. To ensure consistent # results we make the source executable. chmod 755 $SANDPIT/src/src$i done echo "testing ' ... ' mode ..." # target directory exists adeinst $SANDPIT/src/src1 $SANDPIT/src/src2 $SANDPIT/dst/experiment1 # target directory does not exist echo "testing ' ... ' mode with non-existent dest directory ..." adeinst $SANDPIT/src/src3 $SANDPIT/src/src4 $SANDPIT/dst/experiment1/subdir 2>&1 | sed 's/: .*:/: VARIABLE_PATH_NAME:/' echo "doing some checks ..." # 'ls -l's date format is dependent on locale. export LC_ALL=C ( cd $SANDPIT/dst/experiment1 && find . \! -name . | xargs ls -ld | awk '{ print $1 " " $5 " " $9 }' ) echo "testing ' ... ' mode with more files ..." # target directory exists adeinst $SANDPIT/src/* $SANDPIT/dst/experiment2 echo "doing some checks ..." # 'ls -l's date format is dependent on locale. export LC_ALL=C ( cd $SANDPIT/dst/experiment2 && find . \! -name . | xargs ls -ld | awk '{ print $1 " " $5 " " $9 }' )