Subject: motd check for postinstall
To: None <tech-userlevel@netbsd.org>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-userlevel
Date: 09/18/2006 17:44:57
------=_Part_147515_8527163.1158594297578
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,

After adding the "bug reporting" messages to motd, I was suggested to
add a check to postinstall to ensure that motd was updated accordingly
during a release update.  Yes, there is etcupdate to do this, but this
is not run by sysinst.

The attached patch does this.  It checks if the motd's are different
and installs a new one if needed.  Local changes are preserved as long
as the original text is removed; any better (yet still simple!)
solution?

Thanks.

-- 
Julio M. Merino Vidal <jmmv84@gmail.com>
The Julipedia - http://julipedia.blogspot.com/

------=_Part_147515_8527163.1158594297578
Content-Type: text/x-patch; name="patch.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="patch.diff"

SW5kZXg6IHBvc3RpbnN0YWxsCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IC9jdnNyb290L3NyYy91c3Iu
c2Jpbi9wb3N0aW5zdGFsbC9wb3N0aW5zdGFsbCx2CnJldHJpZXZpbmcgcmV2aXNpb24gMS4yNwpk
aWZmIC11IC1wIC1yMS4yNyBwb3N0aW5zdGFsbAotLS0gcG9zdGluc3RhbGwJMTIgU2VwIDIwMDYg
MDE6MTU6MTYgLTAwMDAJMS4yNworKysgcG9zdGluc3RhbGwJMTggU2VwIDIwMDYgMTU6MTg6MDUg
LTAwMDAKQEAgLTY3Myw2ICs2NzMsNDQgQEAgZG9fbWFrZWRldigpCiB9CiAKICMKKyMJbW90ZAor
IworYWRkaXRlbSBtb3RkICJjb250ZW50cyBvZiBtb3RkIgorZG9fbW90ZCgpCit7CisJWyAtbiAi
JDEiIF0gfHwgZXJyIDIgIlVTQUdFOiBkb19tb3RkICBmaXh8Y2hlY2siCisKKwlpZiBncmVwICdo
dHRwO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