aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2011-05-07 04:44:49 +0800
committerjhb <jhb@FreeBSD.org>2011-05-07 04:44:49 +0800
commit56a5d909ea30628d2750ba93b57bb2023d51c862 (patch)
tree9c0129582f6341e5ef6a3dfa69c34ef1fdb21036 /sysutils
parent822023b389f6b4ccc7448e6179c63a8803a15331 (diff)
downloadfreebsd-ports-gnome-56a5d909ea30628d2750ba93b57bb2023d51c862.tar.gz
freebsd-ports-gnome-56a5d909ea30628d2750ba93b57bb2023d51c862.tar.zst
freebsd-ports-gnome-56a5d909ea30628d2750ba93b57bb2023d51c862.zip
- Fix a regression in the previous revision that broke exiting if the
make commands used to build an /etc tree failed. - Autoupdate /etc/motd via /etc/rc.d/motd if /etc/motd is updated. - Bump to 0.3. Reported by: Jason Hellenthal jhell of dataix net (1) Requested by: brooks (2)
Diffstat (limited to 'sysutils')
-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
}