Module Name:    src
Committed By:   apb
Date:           Thu Jan 23 21:45:27 UTC 2014

Modified Files:
        src/distrib/sets: Makefile

Log Message:
Remove time= keywords from METALOG.sanitised.

The times add unnecessary differences to the DESTDIR trees for MKREPRO
builds, and they are not needed by anything.  (maketars, the chief
consumer of METALOG.sanitised, explicitly ignores the time fields.)

Also factor out some duplicated code and update comments.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/distrib/sets/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/Makefile
diff -u src/distrib/sets/Makefile:1.91 src/distrib/sets/Makefile:1.92
--- src/distrib/sets/Makefile:1.91	Thu Jan 16 01:15:33 2014
+++ src/distrib/sets/Makefile	Thu Jan 23 21:45:27 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.91 2014/01/16 01:15:33 christos Exp $
+#	$NetBSD: Makefile,v 1.92 2014/01/23 21:45:27 apb Exp $
 
 # Experimental RCS METALOG versioning
 # (Needs host's rcs(1) commands)
@@ -101,19 +101,25 @@ list_set_files_base list_set_files_x lis
 # MKUNPRIVED flag.
 #
 # The sanitise_METALOG target creates METALOG.sanitised from METALOG,
-# without modifying METALOG itself.  METALOG.sanitised is sorted, and
-# has duplicates merged.  This is used near the end of a build, after
-# build products have been installed in DESTDIR and corresponding lines
-# have been added to METALOG, but before METALOG.sanitised is used in
-# the creation of sets in RELEASEDIR.
+# without modifying METALOG itself.  This is used near the end of
+# a build, after build products have been installed in DESTDIR
+# and corresponding lines have been added to METALOG, but before
+# METALOG.sanitised is used in the creation of sets in RELEASEDIR.
+# For update builds, METALOG.sanitised has duplicates merged (keeping
+# only the last of multiple entries for the same item), but for clean
+# builds it's an error if a file or directory name appears twice.
+# METALOG.sanitised is always sorted and has timestamps removed.
 #
-# The clean_METALOG either deletes METALOG or replaces METALOG with
+# The clean_METALOG target either deletes METALOG, or replaces METALOG with
 # a sanitised version of itself, depending on the MKUPDATE flag, and
 # deletes old METALOG.* files.  This is intended to be used at the start
 # of a build, to ensure that repeated MKUPDATE builds do not cause
 # unbounded growth of METALOG.
 #
 
+METALOG_REMOVE_DUPLICATES= \
+	${TOOL_AWK} '{ a[$$1] = $$0; } END { for (f in a) print a[f]; }'
+
 .if ${MKUNPRIVED} == "no"
 METALOG.unpriv=
 sanitise_METALOG: .PHONY
@@ -124,17 +130,10 @@ clean_METALOG: .PHONY
 METALOG.unpriv= -M ${METALOG}.sanitised
 sanitise_METALOG: .PHONY ${METALOG}.sanitised
 ${METALOG}.sanitised: ${METALOG}
-# We keep only the last entry for update builds, but for clean builds we
-# want to make sure we install files only once.
-.if ${MKUPDATE} != "no"
-	${TOOL_AWK} \
-	    '{ a[$$1] = $$0; } END { for (f in a) print a[f]; }' ${METALOG} | \
-	    sort | ${TOOL_MTREE} -CSM -k all -N ${NETBSDSRCDIR}/etc \
-	    >${METALOG}.new
-.else
-	    sort ${METALOG} | ${TOOL_MTREE} -CSM -k all -N ${NETBSDSRCDIR}/etc \
+	<${METALOG} \
+	    ${${MKUPDATE} != "no" :? ${METALOG_REMOVE_DUPLICATES} | :} \
+	    sort | ${TOOL_MTREE} -CSM -k all -R time -N ${NETBSDSRCDIR}/etc \
 	    >${METALOG}.new
-.endif
 	mv ${METALOG}.new ${METALOG}.sanitised
 .if defined(RCSMETALOG)
 	. ./metalog.subr; \

Reply via email to