- 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)
This commit is contained in:
John Baldwin 2011-05-06 20:44:49 +00:00
parent 855c15727f
commit 215ed6bfb4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=273718
3 changed files with 29 additions and 5 deletions

View File

@ -8,7 +8,7 @@
#
PORTNAME= etcupdate
PORTVERSION= 0.2
PORTVERSION= 0.3
CATEGORIES= sysutils
MASTER_SITES= # none
DISTFILES= # none

View File

@ -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

View File

@ -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
}