summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2007-01-26 07:57:04 +0000
committerrillig <rillig@pkgsrc.org>2007-01-26 07:57:04 +0000
commit416baedaae5b6c4e839ac734ead529c257696cbc (patch)
tree7c514b6e2ccca30aa20986162022efcfe8d66b26 /bootstrap
parent8fa7eceeec24cf2e4acb0468bc3d8def9bb2256f (diff)
downloadpkgsrc-416baedaae5b6c4e839ac734ead529c257696cbc.tar.gz
The example mk.conf is installed automatically if there isn't already a
mk.conf. This makes using pkgsrc a bit easier.
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap/bootstrap22
1 files changed, 19 insertions, 3 deletions
diff --git a/bootstrap/bootstrap b/bootstrap/bootstrap
index 8034b9f4f5c..0cfebb5aa6a 100755
--- a/bootstrap/bootstrap
+++ b/bootstrap/bootstrap
@@ -1,6 +1,6 @@
#! /bin/sh
-# $NetBSD: bootstrap,v 1.88 2006/11/06 21:08:42 tv Exp $
+# $NetBSD: bootstrap,v 1.89 2007/01/26 07:57:04 rillig Exp $
#
#
# Copyright (c) 2001-2002 Alistair G. Crooks. All rights reserved.
@@ -909,6 +909,20 @@ register_package "pkgtools/pkg_install"
echo_msg "Installing packages(7) man page"
run_cmd "(cd $pkgsrcdir/pkgtools/pkgmanpages && $bmake PKG_VERBOSE=yes MAKECONF=${MKCONF_EXAMPLE} WRKOBJDIR=$wrkobjdir CREATE_WRKDIR_SYMLINK=no install)"
+etc_mk_conf="$sysconfdir/mk.conf"
+
+# Install the example mk.conf so that it is used, but only if it doesn't
+# exist yet.
+#
+# Note: I can remember that there had been some reason why this step
+# should be left out, but I can't recall it. So if you remove this code,
+# please document the reason here.
+mkdir_p "$sysconfdir"
+if [ ! -f "$etc_mk_conf" ]; then
+ cp "$MKCONF_EXAMPLE" "$etc_mk_conf"
+ MKCONF_EXAMPLE="$etc_mk_conf"
+fi
+
hline="==========================================================================="
echo ""
echo "$hline"
@@ -921,8 +935,10 @@ echo "has been created for you. It can be found in:"
echo ""
echo " ${MKCONF_EXAMPLE}"
echo ""
-echo "Please copy it to ${sysconfdir}/mk.conf to use it."
-echo ""
+if [ "$MKCONF_EXAMPLE" != "$etc_mk_conf" ]; then
+ echo "Please copy it to $etc_mk_conf to use it."
+ echo ""
+fi
echo "You can find extensive documentation of the NetBSD Packages Collection"
echo "in $pkgsrcdir/doc/pkgsrc.txt and packages(7)."
echo ""