summaryrefslogtreecommitdiff
path: root/sysutils/etcupdate
diff options
context:
space:
mode:
authormartti <martti>2001-11-23 19:16:38 +0000
committermartti <martti>2001-11-23 19:16:38 +0000
commitb1fe489086727e5cedfa372e749265da4c228d12 (patch)
tree116dc358859a725f1c06a52053e61850f2318ab7 /sysutils/etcupdate
parenta47439c6002b424ca6734155201efb3fad0be920 (diff)
downloadpkgsrc-b1fe489086727e5cedfa372e749265da4c228d12.tar.gz
Changed the -b argument. Now etcupdate is used like this:
# etcupdate -s /usr/src or # mkdir /tmp/etc && cd /tmp/etc && tar xf /some/where/etc.tgz # etcupdate -b -s /tmp/etc
Diffstat (limited to 'sysutils/etcupdate')
-rw-r--r--sysutils/etcupdate/Makefile4
-rwxr-xr-xsysutils/etcupdate/files/etcupdate42
-rw-r--r--sysutils/etcupdate/files/etcupdate.852
3 files changed, 67 insertions, 31 deletions
diff --git a/sysutils/etcupdate/Makefile b/sysutils/etcupdate/Makefile
index 27a922e61ed..5536b37bf59 100644
--- a/sysutils/etcupdate/Makefile
+++ b/sysutils/etcupdate/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.5 2001/11/22 15:39:30 martti Exp $
+# $NetBSD: Makefile,v 1.6 2001/11/23 19:16:38 martti Exp $
-DISTNAME= etcupdate-20011122.1
+DISTNAME= etcupdate-20011123
CATEGORIES= sysutils
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/sysutils/etcupdate/files/etcupdate b/sysutils/etcupdate/files/etcupdate
index 815291f7399..9f5e854c56d 100755
--- a/sysutils/etcupdate/files/etcupdate
+++ b/sysutils/etcupdate/files/etcupdate
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: etcupdate,v 1.6 2001/11/22 15:39:31 martti Exp $
+# $NetBSD: etcupdate,v 1.7 2001/11/23 19:16:38 martti Exp $
#
# Copyright (c) 2001 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -73,7 +73,7 @@ Usage: `basename $0` [options]
Options:
- -b binfile Location of the .tgz files
+ -b Use binary distributions
-p pager Which pager to use (default: /usr/bin/more)
-s srcdir Location of the source files (default: /usr/src)
-t temproot Where to store temporary files (default: /tmp/temproot)
@@ -244,14 +244,14 @@ USERRC="${HOME}/.`basename $0`rc"
[ -r ${USERRC} ] && . ${USERRC}
# Read command line arguments
-ARGV=`getopt b:hp:s:t:vw: $*`
+ARGV=`getopt bhp:s:t:vw: $*`
[ $? != 0 ] && usage
set -- ${ARGV}
for i; do
case "${i}" in
-b)
- BINARY="${BINARY} ${2}"
- shift 2
+ BINARY=YES
+ shift
;;
-h)
usage
@@ -288,6 +288,9 @@ if [ `id -u` -ne 0 ]; then
echo "*** ERROR: You MUST be root"
exit 1
fi
+if [ ! -z "${BINARY}" ]; then
+ TEMPROOT="${SRCDIR}"
+fi
if [ -z "${SRCDIR}" -o -z "${TEMPROOT}" ]; then
echo "*** ERROR: One of the following variables is undefined"
echo ""
@@ -296,7 +299,7 @@ if [ -z "${SRCDIR}" -o -z "${TEMPROOT}" ]; then
echo ""
exit 1
fi
-if [ -r "${TEMPROOT}" ]; then
+if [ -z "${BINARY}" -a -r "${TEMPROOT}" ]; then
echo ""
echo "*** WARNING: ${TEMPROOT} already exists"
echo ""
@@ -309,16 +312,16 @@ if [ -r "${TEMPROOT}" ]; then
fi
if [ -z "${CONTINUE}" ]; then
- # Create the temporary root directory
- echo "*** Creating ${TEMPROOT}"
- mkdir -p "${TEMPROOT}"
- if [ ! -d "${TEMPROOT}" ]; then
- echo "*** ERROR: Unable to create ${TEMPROOT}"
- exit 1
- fi
-
# Are we using the sources or binaries?
if [ -z "${BINARY}" ]; then
+ # Create the temporary root directory
+ echo "*** Creating ${TEMPROOT}"
+ mkdir -p "${TEMPROOT}"
+ if [ ! -d "${TEMPROOT}" ]; then
+ echo "*** ERROR: Unable to create ${TEMPROOT}"
+ exit 1
+ fi
+
# Populate ${TEMPROOT} from ${SRCDIR}
if [ ! -f "${SRCDIR}/etc/Makefile" ]; then
echo "*** ERROR: Unable to find ${SRCDIR}/etc/Makefile"
@@ -335,11 +338,12 @@ if [ -z "${CONTINUE}" ]; then
INSTALL_DONE=1 NO_SENDMAIL=1 \
distribution
fi
- else
- for i in ${BINARY}; do
- echo "*** Extracting ${i} to ${TEMPROOT}"
- tar xzf "${i}" -C "${TEMPROOT}"
- done
+ elif [ ! -f "${TEMPROOT}/dev/MAKEDEV" ]; then
+ echo ""
+ echo "*** WARNING: ${TEMPROOT}/dev/MAKEDEV not found"
+ echo "Make sure you update /dev/MAKEDEV later and run"
+ echo "(cd /dev && ./MAKEDEV all) to rebuild the device nodes"
+ echo ""
fi
# Ignore the following files during comparision
diff --git a/sysutils/etcupdate/files/etcupdate.8 b/sysutils/etcupdate/files/etcupdate.8
index 897f08dcabe..be09e180494 100644
--- a/sysutils/etcupdate/files/etcupdate.8
+++ b/sysutils/etcupdate/files/etcupdate.8
@@ -1,4 +1,4 @@
-.\" $NetBSD: etcupdate.8,v 1.4 2001/11/22 15:39:31 martti Exp $
+.\" $NetBSD: etcupdate.8,v 1.5 2001/11/23 19:16:38 martti Exp $
.\"
.\" Copyright (c) 2001 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -43,7 +43,7 @@
.Pa /etc
.Sh SYNOPSIS
.Nm
-.Op Fl b Ar binfile
+.Op Fl b
.Op Fl h
.Op Fl p Ar pager
.Op Fl s Ar srcdir
@@ -108,6 +108,25 @@ but it can be changed either with the
argument or by defining the
.Ev SRCDIR
variable.
+.Pp
+If the
+.Fl b
+flag is not used,
+.Nm
+expects to find
+.Pa etc/Makefile
+within the source directory. This will be used to create the temporary
+files in
+.Pa /tmp/temproot .
+.Pp
+If the
+.Fl b
+flag is used (maybe together with the
+.Fl s Ar srcdir
+argument),
+.Nm
+uses the source directory directly as the temporary directory
+.Pa ( /tmp/temproot ) .
.It Ev PAGER
The pager to use when displaying files. By default this is
.Xr more 1
@@ -131,10 +150,10 @@ users with wider shell windows.
The environment variables can also be defined in the following configuration
files. The user's personal configuration file settings override the global
settings.
-.Bl -tag -offset indent
-.It Pa /etc/etcupdate.conf
-.It Pa ~/.etcupdaterc
-.El
+.Pp
+/etc/etcupdate.conf
+.Pp
+~/.etcupdaterc
.Sh EXAMPLES
You have just upgraded your
.Nx
@@ -143,6 +162,7 @@ to update the configuration files as well.
To update the configuration files from the sources (if you have the
.Pa /usr/src
directory):
+.Pp
.Dl etcupdate
.Pp
The default location of the source files is
@@ -150,17 +170,29 @@ The default location of the source files is
but this may be overridden with the
.Fl s Ar srcdir
command line argument:
+.Pp
.Dl etcupdate -s /some/where/src
.Pp
To update the configuration files from binary distribution packages
-(note that you can specify more than one
-.Fl b Ar binfile
-argument):
-.Dl etcupdate -b /some/where/etc.tgz
+do something like this:
+.Pp
+.Dl mkdir /tmp/etc
+.Dl cd /tmp/etc
+.Dl tar xf /some/where/etc.tgz
+.Dl etcupdate -b -s /tmp/etc
+.Pp
+The
+.Fl b
+flag tells
+.Nm
+that the source directory does not have any
+.Pa etc/Makefile
+but the files from the binary distribution set(s).
.Pp
To get a better idea what's going on, use the
.Fl v
flag:
+.Pp
.Dl etcupdate -v
.Sh AUTHORS
The