Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc motd needs to be re-generated when DISTRIBVER changes, s...



details:   https://anonhg.NetBSD.org/src/rev/32f7e89a021c
branches:  trunk
changeset: 782479:32f7e89a021c
user:      apb <apb%NetBSD.org@localhost>
date:      Sun Nov 04 11:09:14 2012 +0000

description:
motd needs to be re-generated when DISTRIBVER changes, so change he
Makefile to use the new ${_NETBSD_VERSION_DEPENDS} mechanism defined in
bsd.own.mk.

Rename the default motd file in the source tree from "motd" to
"motd.default", because otherwise it would conflict with the motd file
that is now created in the .OBJDIR.

diffstat:

 etc/Makefile     |  35 ++++++++++++++++++++---------------
 etc/motd         |   4 ----
 etc/motd.default |   4 ++++
 3 files changed, 24 insertions(+), 19 deletions(-)

diffs (73 lines):

diff -r b6da451ec3eb -r 32f7e89a021c etc/Makefile
--- a/etc/Makefile      Sun Nov 04 11:04:10 2012 +0000
+++ b/etc/Makefile      Sun Nov 04 11:09:14 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.399 2012/11/04 11:04:10 apb Exp $
+#      $NetBSD: Makefile,v 1.400 2012/11/04 11:09:14 apb Exp $
 #      from: @(#)Makefile      8.7 (Berkeley) 5/25/95
 
 # Environment variables without default values:
@@ -114,21 +114,8 @@
 .endif
 
 # -rw-rw-r--
-.if !empty(DISTRIBVER:M*.99.*)
-BIN2+= motd.current
-FILESNAME_motd.current=        motd
-.elif !empty(DISTRIBVER:M*BETA*)
-BIN2+= motd.beta
-FILESNAME_motd.beta=   motd
-.elif !empty(DISTRIBVER:M*RC*)
-BIN2+= motd.rc
-FILESNAME_motd.rc=     motd
-.elif !empty(DISTRIBVER:M*STABLE*)
-BIN2+= motd.stable
-FILESNAME_motd.stable= motd
-.else
 BIN2+= motd
-.endif
+FILESBUILD_motd=       YES
 
 # -rw-------
 BIN3+= hosts.equiv
@@ -172,6 +159,24 @@
 .endif # !DISTRIBUTION_DONE
 
 
+# motd is copied from a different ${MOTD_SOURCE} depending on DISTRIBVER
+#
+.if !empty(DISTRIBVER:M*.99.*)
+MOTD_SOURCE=   motd.current
+.elif !empty(DISTRIBVER:M*BETA*)
+MOTD_SOURCE=   motd.beta
+.elif !empty(DISTRIBVER:M*RC*)
+MOTD_SOURCE=   motd.rc
+.elif !empty(DISTRIBVER:M*STABLE*)
+MOTD_SOURCE=   motd.stable
+.else
+MOTD_SOURCE=   motd.default
+.endif
+CLEANFILES+= motd
+motd: ${.CURDIR}/${MOTD_SOURCE} ${_NETBSD_VERSION_DEPENDS}
+       ${_MKTARGET_CREATE}
+       ${HOST_INSTALL_FILE} ${.CURDIR}/${MOTD_SOURCE} ${.TARGET}
+
 CLEANFILES+=   MAKEDEV
 MAKEDEV: ${.CURDIR}/MAKEDEV.awk ${.CURDIR}/MAKEDEV.tmpl \
     ${.CURDIR}/etc.${MACHINE}/MAKEDEV.conf
diff -r b6da451ec3eb -r 32f7e89a021c etc/motd
--- a/etc/motd  Sun Nov 04 11:04:10 2012 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-NetBSD ?.? (UNKNOWN)
-
-Welcome to NetBSD!
-
diff -r b6da451ec3eb -r 32f7e89a021c etc/motd.default
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/motd.default  Sun Nov 04 11:09:14 2012 +0000
@@ -0,0 +1,4 @@
+NetBSD ?.? (UNKNOWN)
+
+Welcome to NetBSD!
+



Home | Main Index | Thread Index | Old Index