Mon Feb 18 00:00:55 2013 UTC ()
only do the keep last in update builds and explain why.


(christos)
diff -r1.85 -r1.86 src/distrib/sets/Makefile

cvs diff -r1.85 -r1.86 src/distrib/sets/Makefile (expand / switch to unified diff)

--- src/distrib/sets/Makefile 2013/02/17 23:56:52 1.85
+++ src/distrib/sets/Makefile 2013/02/18 00:00:55 1.86
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.85 2013/02/17 23:56:52 christos Exp $ 1# $NetBSD: Makefile,v 1.86 2013/02/18 00:00:55 christos Exp $
2 2
3# Experimental RCS METALOG versioning 3# Experimental RCS METALOG versioning
4# (Needs host's rcs(1) commands) 4# (Needs host's rcs(1) commands)
5# 5#
6# TODO: 6# TODO:
7# - In 'build.sh distribution', print diff to previous 7# - In 'build.sh distribution', print diff to previous
8#RCSMETALOG=1 8#RCSMETALOG=1
9 9
10# The `all' target must appear before bsd.own.mk is pulled in. 10# The `all' target must appear before bsd.own.mk is pulled in.
11all: 11all:
12 @echo "Please understand what you are doing, first." 12 @echo "Please understand what you are doing, first."
13 @false 13 @false
14 14
@@ -114,30 +114,37 @@ list_set_files_base list_set_files_x lis @@ -114,30 +114,37 @@ list_set_files_base list_set_files_x lis
114# unbounded growth of METALOG. 114# unbounded growth of METALOG.
115# 115#
116 116
117.if ${MKUNPRIVED} == "no" 117.if ${MKUNPRIVED} == "no"
118METALOG.unpriv= 118METALOG.unpriv=
119sanitise_METALOG: .PHONY 119sanitise_METALOG: .PHONY
120 @true 120 @true
121clean_METALOG: .PHONY 121clean_METALOG: .PHONY
122 @true 122 @true
123.else # MKUNPRIVED 123.else # MKUNPRIVED
124METALOG.unpriv= -M ${METALOG}.sanitised 124METALOG.unpriv= -M ${METALOG}.sanitised
125sanitise_METALOG: .PHONY ${METALOG}.sanitised 125sanitise_METALOG: .PHONY ${METALOG}.sanitised
126${METALOG}.sanitised: ${METALOG} 126${METALOG}.sanitised: ${METALOG}
 127# We keep only the last entry for update builds, but for clean builds we
 128# want to make sure we install files only once.
 129.if ${MKUPDATE} != "no"
127 ${TOOL_AWK} \ 130 ${TOOL_AWK} \
128 '{ a[$$1] = $$0; } END { for (f in a) print a[f]; }' ${METALOG} | \ 131 '{ a[$$1] = $$0; } END { for (f in a) print a[f]; }' ${METALOG} | \
129 sort | ${TOOL_MTREE} -CSM -k all -N ${NETBSDSRCDIR}/etc \ 132 sort | ${TOOL_MTREE} -CSM -k all -N ${NETBSDSRCDIR}/etc \
130 >${METALOG}.new 133 >${METALOG}.new
 134.else
 135 sort ${METALOG} | ${TOOL_MTREE} -CSM -k all -N ${NETBSDSRCDIR}/etc \
 136 >${METALOG}.new
 137.endif
131 mv ${METALOG}.new ${METALOG}.sanitised 138 mv ${METALOG}.new ${METALOG}.sanitised
132.if defined(RCSMETALOG) 139.if defined(RCSMETALOG)
133 . ./metalog.subr; \ 140 . ./metalog.subr; \
134 xrcs_descr="build distribution METALOG"; \ 141 xrcs_descr="build distribution METALOG"; \
135 xrcs_msg="$$(date)"; \ 142 xrcs_msg="$$(date)"; \
136 xrcs_cur=${METALOG}.sanitised; \ 143 xrcs_cur=${METALOG}.sanitised; \
137 xrcs update 144 xrcs update
138.endif 145.endif
139.if ${MKUPDATE} == "no" || !exists(${METALOG}) 146.if ${MKUPDATE} == "no" || !exists(${METALOG})
140clean_METALOG: .PHONY 147clean_METALOG: .PHONY
141 rm -f ${METALOG} ${METALOG}.* 148 rm -f ${METALOG} ${METALOG}.*
142.else # MKUPDATE 149.else # MKUPDATE
143clean_METALOG: .PHONY ${METALOG}.sanitised 150clean_METALOG: .PHONY ${METALOG}.sanitised