tech-userlevel archive

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

Re: etc/motd not updated

On Thu, 18 Oct 2012, Edgar Fu wrote:
I have a netbsd-6 source tree. After the 6.0 release, I updated to netbsd-6-0. When I now distribution, I end up with an etc.tgz where ./etc/motd still talks about a release canidate. It looks like obj/destdir.XXX/etc/motd lacks some dependency and doesn't get updated.

DESTDIR/etc/motd is created from different source files depending on pattern matching against ${DISTRIBVER} in etc/Makefile. If DISTRIBVER changes, then the rules change, but nothing notices that the installed file might need to change.

The appended patch adds a a dependency on an intermediate file in the .OBJDIR called motd.${DISTRIBVER}, and recreates that file whenever DISTRIBVER changes. In addition to applying this patch, you need to rename src/etc/motd to src/etc/motd.default. If the patch appears to be mangled, try looking for lines that start with two or more spaces, and remove one of those spaces; it's an artefact of
the "text/plain; format=flowed" content type.

This change to the build process has the side effect of changing the timestamp of the installed DESTDIR/etc/motd. Previously, it would have been the same as the timestamp of the source etc/motd{,.current,.beta,.stable,.rc}, but now it will be the timestamp of the motd.${DISTRIBVER} file created during the first build with a particular value of ${DISTRIBVER}.

--apb (Alan Barrett)

Index: etc/Makefile
RCS file: /home/apb/netbsd/cvsmirror/cvsroot/src/etc/Makefile,v
retrieving revision 1.398
diff -d -p -u -r1.398 Makefile
--- etc/Makefile        17 Aug 2012 16:59:26 -0000      1.398
+++ etc/Makefile        19 Oct 2012 08:09:57 -0000
@@ -114,21 +114,8 @@ BIN1+=     etc.${MACHINE}/ttyaction

# -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
BIN2+=  motd
+FILESBUILD_motd=       YES

# -rw-------
BIN3+=  hosts.equiv
@@ -172,6 +159,31 @@ distribution: .PHONY .MAKE check_DESTDIR

+# Force motd to be recreated if DISTRIBVER changes.
+# This doesn't work if you flip back and forth between two values of
+# DISTRIBVER without "make clean" in between, but it works in the common
+# case that DISTRIBVER goes forwards without a "make clean".
+.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
+MOTD_SOURCE=   motd.default
+CLEANFILES+= motd.[0-9]*
+       #${_MKTARGET_CREATE}
+motd: motd.${DISTRIBVER}

Home | Main Index | Thread Index | Old Index