#!/bin/bash # $HeadURL$ $LastChangedRevision$ echo "loading support modules ..." . $(ade-config ade_share_prefix)/include/adetestsupport.sh echo "setting up environment ..." SANDPIT=$(pwd) # We are going to install this module into a temp directory, with absolutely # no deferring to environment variables or to the contents of the -config.sh # script. First we need to work out the name of the script and also the # environment variable prefix, both of which depend on the name of the module, # which we don't know yet. So get that first. MODULE=$(ls $ADETEST_MODROOT/bin | sed -n 's/devsh.sh//p') UC_MODULE=${MODULE^^} [ "X$MODULE" != X ] || adetestsupport_error "can't get the name of this module" # Now we can unset environment variables set by *this* module's *-devsh # script, which we may be running under. eval "$(env | sed -nr "s/^(${UC_MODULE}_[A-Z_]+=).*/\\1/p")" echo "copying sources from working copy to sandpit and blanking settings in *-config.sh ..." cp -ar $ADETEST_MODROOT sources cd sources MODULE_CONFIG_SH=bin/$MODULE-config.sh perl -pi -e "s@^(${UC_MODULE}_(?:|LIB_|DOC_|BIN_|SHARE_|MAN_|MAN1_|MAN2_|MAN3_|MAN4_|MAN5_|MAN6_|MAN7_|MAN8_|ETC_|STATE_|LOG_)PREFIX)=.*@\$1=@; s@(^${UC_MODULE}_PREFIX)=@\$1=$SANDPIT/target@;" $MODULE_CONFIG_SH echo "remaking and installing ..." make clean distclean > /dev/null 2>&1 make > /dev/null 2>&1 make install > /dev/null 2>&1 echo "checking target contains all man pages ..." cd ../target echo "examining symlinks in target dir ..." find . -type l -printf '%p -> %l\n' | sort