aboutsummaryrefslogtreecommitdiff
path: root/sysutils/etcupdate
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2011-05-06 20:44:49 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2011-05-06 20:44:49 +0000
commit215ed6bfb42b08f58b90d493edd0db0572b33414 (patch)
tree7046fb1a21c24240e463dcf9b316fd9c00e38d4b /sysutils/etcupdate
parent855c15727faa495dc7717f54516db16e016897f0 (diff)
downloadports-215ed6bfb42b08f58b90d493edd0db0572b33414.tar.gz
ports-215ed6bfb42b08f58b90d493edd0db0572b33414.zip
Notes
Diffstat (limited to 'sysutils/etcupdate')
-rw-r--r--sysutils/etcupdate/Makefile2
-rw-r--r--sysutils/etcupdate/src/etcupdate.818
-rw-r--r--sysutils/etcupdate/src/etcupdate.sh14
3 files changed, 29 insertions, 5 deletions
diff --git a/sysutils/etcupdate/Makefile b/sysutils/etcupdate/Makefile
index 700dc24acf15..c090019ed261 100644
--- a/sysutils/etcupdate/Makefile
+++ b/sysutils/etcupdate/Makefile
@@ -8,7 +8,7 @@
#
PORTNAME= etcupdate
-PORTVERSION= 0.2
+PORTVERSION= 0.3
CATEGORIES= sysutils
MASTER_SITES= # none
DISTFILES= # none
diff --git a/sysutils/etcupdate/src/etcupdate.8 b/sysutils/etcupdate/src/etcupdate.8
index 205d2faf4529..ce4471e4aac6 100644
--- a/sysutils/etcupdate/src/etcupdate.8
+++ b/sysutils/etcupdate/src/etcupdate.8
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 26, 2010
+.Dd May 6, 2011
.Dt ETCUPDATE 8
.Os
.Sh NAME
@@ -228,10 +228,14 @@ is invoked to update
if
.Pa /etc/login.conf
is changed,
-and
.Xr newaliases 1
is invoked if
.Pa /etc/mail/aliases
+is changed,
+and
+.Pa /etc/rc.d/motd
+is invoked if
+.Pa /etc/motd
is changed.
One exception is that if
.Pa /etc/mail/aliases
@@ -240,6 +244,16 @@ then a warning will be issued instead.
This is due to a limitation of the
.Xr newaliases 1
command.
+Similarly,
+if
+.Pa /etc/motd
+is changed and the destination directory is not the default,
+then
+.Pa /etc/rc.d/motd
+will not be executed due to a limitation of that script.
+In this case no warning is issued as the result of
+.Pa /etc/rc.d/motd
+is merely cosmetic and will be corrected on the next reboot.
.Ss Build Mode
The
.Cm build
diff --git a/sysutils/etcupdate/src/etcupdate.sh b/sysutils/etcupdate/src/etcupdate.sh
index 61aa95ca8345..b2a9dddd4bf7 100644
--- a/sysutils/etcupdate/src/etcupdate.sh
+++ b/sysutils/etcupdate/src/etcupdate.sh
@@ -57,7 +57,6 @@
# TODO:
# - automatable conflict resolution
# - a 'revert' command to make a file "stock"
-# - invoke /etc/rc.d/motd if /etc/motd changes?
usage()
{
@@ -194,7 +193,7 @@ build_tree()
(cd $SRCDIR; \
MAKEOBJDIRPREFIX=$1/usr/obj $make _obj SUBDIR_OVERRIDE=etc &&
MAKEOBJDIRPREFIX=$1/usr/obj $make everything SUBDIR_OVERRIDE=etc &&
- MAKEOBJDIRPREFIX=$1/usr/obj $make DESTDIR=$1 distribution) >&3 2>&1
+ MAKEOBJDIRPREFIX=$1/usr/obj $make DESTDIR=$1 distribution) \
>&3 2>&1 || return 1
else
(cd $SRCDIR; $make DESTDIR=$1 distribution) >&3 2>&1 || return 1
@@ -557,6 +556,17 @@ post_install_file()
>&3 2>&1
fi
;;
+ /etc/motd)
+ # /etc/rc.d/motd hardcodes the /etc/motd path.
+ # Don't warn about non-empty DESTDIR's since this
+ # change is only cosmetic anyway.
+ if [ -z "$DESTDIR" ]; then
+ log "sh /etc/rc.d/motd start"
+ if [ -z "$dryrun" ]; then
+ sh /etc/rc.d/motd start >&3 2>&1
+ fi
+ fi
+ ;;
esac
}