From 35b7efca9b25e5e2aedfd80bd8114e1018369f9e Mon Sep 17 00:00:00 2001 From: dmcmahill Date: Thu, 14 Nov 2002 14:05:46 +0000 Subject: - when creating a new database, make sure that the old one is gone first to avoid simply appending to it. - add some additional error checks when using the -r/--restart options to make sure that the database exists and give a useful error message if it doesn't --- mk/bulk/mkreadme | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'mk') diff --git a/mk/bulk/mkreadme b/mk/bulk/mkreadme index 3a55a73acf2..2999869616b 100755 --- a/mk/bulk/mkreadme +++ b/mk/bulk/mkreadme @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: mkreadme,v 1.7 2002/11/13 15:12:17 dmcmahill Exp $ +# $NetBSD: mkreadme,v 1.8 2002/11/14 14:05:46 dmcmahill Exp $ # # Script for README.html generation # @@ -340,6 +340,10 @@ if [ "x$restart" = "xno" ] ; then echo "Extracting data. This could take a while" echo " " npkg=1 + + # make sure we don't have an old database lying around + rm -fr $DATABASEFILE + cd ${PKGSRCDIR} list=`grep '^[[:space:]]*'SUBDIR */Makefile | sed 's,/Makefile.*=[[:space:]]*,/,'` for pkgdir in $list @@ -375,6 +379,13 @@ else echo " " echo "Using existing database (are you sure you wanted the -r/--restart flag?)" echo " " + if [ ! -f $DATABASEFILE ]; then + echo " " + echo "ERROR: You have use the -r/--restart flag but the database " + echo " file $DATABASEFILE does not exist" + echo " " + exit 1 + fi fi ###################################################################### -- cgit v1.2.3