#!/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 one' # which is: # # adeinst # ############################################################################## echo "creating base directories ..." mkdir $SANDPIT/src $SANDPIT/dst $SANDPIT/dst/mode_1 $SANDPIT/dst/mode_2 $SANDPIT/dst/mode_3 echo "creating some source files ..." for i in 1 2 3 4 5; 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 "installing ' ' mode ..." # target does not exist adeinst $SANDPIT/src/src1 $SANDPIT/dst/mode_1/src1_renamed # target does exist touch $SANDPIT/dst/mode_1/src2_renamed adeinst $SANDPIT/src/src2 $SANDPIT/dst/mode_1/src2_renamed echo "doing some checks ..." # 'ls -l's date format is dependent on locale. export LC_ALL=C ( cd $SANDPIT/dst/mode_1 && find . \! -name . | xargs ls -ld | awk '{ print $1 " " $5 " " $9 }' )