#! /bin/sh # -*- sh -*- # # $Id: empty.test,v 1.1 2003/03/14 18:09:04 richdawe Exp $ # Copyright (C) 2003 by Richard Dawe # # Check that --syncdb works, when the package database is empty. if (test -n "$VERBOSE" -a "$VERBOSE" != "n" ); then set -x fi fail=0 tmproot=`pwd`/$$.root log=`pwd`/empty.log mkdir -p $tmproot || exit 1 mkdir -p ${tmproot}/manifest || exit 1 mkdir -p ${tmproot}/share/pakke/db || exit 1 mkdir -p ${tmproot}/share/pakke/db-avail || exit 1 mkdir -p ${tmproot}/share/pakke/packages || exit 1 # Copy a platform DSM and make up version and manifest files, # so there's something to synchronise. platform=win95 syncdb="$PAKKEOPT --root $tmproot --syncdb -v" cp ${top_srcdir}/src/defaults/platform/${platform}.dsm ${tmproot}/manifest \ || fail=1 echo "win95 Windows 95 (binaries)" >${tmproot}/manifest/${platform}.ver \ || fail=1 touch ${tmproot}/foo || fail=1 echo foo >${tmproot}/manifest/${platform}.mft || fail=1 # Timestamp echo >>$log || fail=1 date >>$log || fail=1 echo >>$log || fail=1 # Syncronise the database. echo $PAKKE $syncdb >>$log || fail=1 $PAKKE $syncdb >>$log 2>&1 || fail=1 # FIXME: This should refer to share/pakke/db. We don't currently # copy the DSMs from manifest to db-avail, so the file won't be there # after synchronisation. So this test isn't valid yet. # ## Success? #test -f ${tmproot}/manifest/${platform}.dsm || fail=1 if [ "$fail" = "0" ]; then rm -rf $tmproot || fail=1 fi exit $fail