aboutsummaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2013-12-27 20:07:00 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2013-12-27 20:07:00 +0000
commit593c57190acbb15b9555e175db993ea7c8598f7f (patch)
treeab98c7c8967e603bb5be38e2ee5de873e63213cf /sysutils
parent3cbd5128e6aaa925efdbdc44b2ca72cf06e4e39b (diff)
downloadports-593c57190acbb15b9555e175db993ea7c8598f7f.tar.gz
ports-593c57190acbb15b9555e175db993ea7c8598f7f.zip
Notes
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/etcupdate/Makefile2
-rw-r--r--sysutils/etcupdate/src/etcupdate.823
-rw-r--r--sysutils/etcupdate/src/etcupdate.sh76
3 files changed, 86 insertions, 15 deletions
diff --git a/sysutils/etcupdate/Makefile b/sysutils/etcupdate/Makefile
index 77734b47f880..283d989d8c3c 100644
--- a/sysutils/etcupdate/Makefile
+++ b/sysutils/etcupdate/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= etcupdate
-PORTVERSION= 1.0
+PORTVERSION= 1.1
CATEGORIES= sysutils
MASTER_SITES= # none
DISTFILES= # none
diff --git a/sysutils/etcupdate/src/etcupdate.8 b/sysutils/etcupdate/src/etcupdate.8
index 91e9e1af15eb..ffd051607312 100644
--- a/sysutils/etcupdate/src/etcupdate.8
+++ b/sysutils/etcupdate/src/etcupdate.8
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2010-2012 Advanced Computing Technologies LLC
+.\" Copyright (c) 2010-2013 Advanced Computing Technologies LLC
.\" Written by: John H. Baldwin <jhb@FreeBSD.org>
.\" All rights reserved.
.\"
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 12, 2013
+.Dd December 9, 2013
.Dt ETCUPDATE 8
.Os
.Sh NAME
@@ -695,6 +695,25 @@ has been removed from the
tree,
but it has been locally modified.
The modified version of the file remains in the destination directory.
+.It "Needs update: /etc/localtime (required manual update via tzsetup(1))"
+The
+.Fa /var/db/zoneinfo
+file does not exist,
+so
+.Nm
+was not able to refresh
+.Fa /etc/localtime
+from its source file in
+.Fa /usr/share/zoneinfo .
+Running
+.Xr tzsetup 1
+will both refresh
+.Fa /etc/localtime
+and generate
+.Fa /var/db/zoneinfo
+permitting future updates to refresh
+.Fa /etc/localtime
+automatically.
.It "Needs update: /etc/mail/aliases.db (required manual update via newaliases(1))"
The file
.Pa /etc/mail/aliases
diff --git a/sysutils/etcupdate/src/etcupdate.sh b/sysutils/etcupdate/src/etcupdate.sh
index 96e507e4388f..addcc14e5366 100644
--- a/sysutils/etcupdate/src/etcupdate.sh
+++ b/sysutils/etcupdate/src/etcupdate.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (c) 2010 Advanced Computing Technologies LLC
+# Copyright (c) 2010-2013 Advanced Computing Technologies LLC
# Written by: John H. Baldwin <jhb@FreeBSD.org>
# All rights reserved.
#
@@ -486,6 +486,39 @@ diffnode()
esac
}
+# Run one-off commands after an update has completed. These commands
+# are not tied to a specific file, so they cannot be handled by
+# post_install_file().
+post_update()
+{
+ local args
+
+ # None of these commands should be run for a pre-world update.
+ if [ -n "$preworld" ]; then
+ return
+ fi
+
+ # If /etc/localtime exists and is not a symlink and /var/db/zoneinfo
+ # exists, run tzsetup -r to refresh /etc/localtime.
+ if [ -f ${DESTDIR}/etc/localtime -a \
+ ! -L ${DESTDIR}/etc/localtime ]; then
+ if [ -f ${DESTDIR}/var/db/zoneinfo ]; then
+ if [ -n "${DESTDIR}" ]; then
+ args="-C ${DESTDIR}"
+ else
+ args=""
+ fi
+ log "tzsetup -r ${args}"
+ if [ -z "$dryrun" ]; then
+ tzsetup -r ${args} >&3 2>&1
+ fi
+ else
+ warn "Needs update: /etc/localtime (required" \
+ "manual update via tzsetup(1))"
+ fi
+ fi
+}
+
# Create missing parent directories of a node in a target tree
# preserving the owner, group, and permissions from a specified
# template tree.
@@ -583,6 +616,14 @@ post_install_file()
fi
fi
;;
+ /etc/services)
+ log "services_mkdb -q -o $DESTDIR/var/db/services.db" \
+ "${DESTDIR}$1"
+ if [ -z "$dryrun" ]; then
+ services_mkdb -q -o $DESTDIR/var/db/services.db \
+ ${DESTDIR}$1 >&3 2>&1
+ fi
+ ;;
esac
}
@@ -1026,16 +1067,6 @@ handle_modified_file()
fi
fi
- # If the only change in the new file versus the old file is a
- # change in the FreeBSD ID string and -F is specified, just
- # update the FreeBSD ID string in the local file.
- if [ -n "$FREEBSD_ID" -a $cmp -eq $COMPARE_DIFFFILES ] && \
- fbsdid_only $OLDTREE/$file $NEWTREE/$file; then
- if update_freebsdid $file; then
- continue
- fi
- fi
-
# If the file was removed from the dest tree, just whine.
if [ $newdestcmp -eq $COMPARE_ONLYFIRST ]; then
# If the removed file matches an ALWAYS_INSTALL glob,
@@ -1050,6 +1081,14 @@ handle_modified_file()
return
fi
+ # If the only change in the new file versus the old
+ # file is a change in the FreeBSD ID string and -F is
+ # specified, don't warn.
+ if [ -n "$FREEBSD_ID" -a $cmp -eq $COMPARE_DIFFFILES ] && \
+ fbsdid_only $OLDTREE/$file $NEWTREE/$file; then
+ return
+ fi
+
case $cmp in
$COMPARE_DIFFTYPE)
old=`file_type $OLDTREE/$file`
@@ -1080,6 +1119,16 @@ handle_modified_file()
fi
fi
+ # If the only change in the new file versus the old file is a
+ # change in the FreeBSD ID string and -F is specified, just
+ # update the FreeBSD ID string in the local file.
+ if [ -n "$FREEBSD_ID" -a $cmp -eq $COMPARE_DIFFFILES ] && \
+ fbsdid_only $OLDTREE/$file $NEWTREE/$file; then
+ if update_freebsdid $file; then
+ continue
+ fi
+ fi
+
# If the file changed types between the old and new trees but
# the files in the new and dest tree are both of the same
# type, treat it like an added file just comparing the new and
@@ -1498,6 +1547,9 @@ EOF
"(requires manual update via newaliases(1))"
fi
+ # Run any special one-off commands after an update has completed.
+ post_update
+
if [ -s $WARNINGS ]; then
echo "Warnings:"
cat $WARNINGS
@@ -1698,7 +1750,7 @@ case $command in
fi
;;
build|diff|status)
- if [ -n "$dryrun" -o -n "$rerun" -o -n "$tarball" -o
+ if [ -n "$dryrun" -o -n "$rerun" -o -n "$tarball" -o \
-n "$preworld" ]; then
usage
fi