#! /bin/sh # -*- sh -*- # # $Id: reldrive.test,v 1.1 2003/03/15 12:14:09 richdawe Exp $ # Copyright (C) 2003 by Richard Dawe # # Check that --upgrade works with a drive-letter relative path # like c:foo. This only works on platforms that support drive letters. if (test -n "$VERBOSE" -a "$VERBOSE" != "n" ); then set -x fi # Is this DOS? If not, skip the test. if (pwd | grep -v -E '^[a-zA-Z]:'); then exit 77 fi # Do we have subst? if (type -a subst | grep 'not found'); then exit 77 fi fail=0 here=`pwd` tmproot=${here}/$$.root log=${here}/reldrive.log # Ensure zipdir is an absolute path. zipdir=`echo ${top_srcdir}/test/zip | sed -e "s,^\.,$here/.,"` zipdrive=t: zip=${zipdrive}docs.zip initdb="$PAKKEOPT --root $tmproot --initdb -v" upgrade="$PAKKEOPT --root $tmproot --upgrade -v $zip" # Timestamp echo >>$log || fail=1 date >>$log || fail=1 echo >>$log || fail=1 zipdirdos=`echo $zipdir | sed -e 's:/:\\\\:g'` echo subst $zipdrive $zipdirdos >>$log || fail=1 subst $zipdrive $zipdirdos >>$log 2>&1 || fail=1 ls $zipdrive >>$log 2>&1 || fail=1 # Initialise the database. echo $PAKKE $initdb >>$log || fail=1 $PAKKE $initdb >>$log 2>&1 || fail=1 # Try installing. echo "zip: $zip" >>$log || fail=1 echo $PAKKE $upgrade >>$log || fail=1 $PAKKE $upgrade >>$log 2>&1 || fail=1 echo subst $zipdrive /d >>$log || fail=1 subst $zipdrive /d >>$log 2>&1 || fail=1 # Success? if [ "$fail" = "0" ]; then rm -rf $tmproot || fail=1 fi exit $fail