Source-Changes-HG archive

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

[src/trunk]: src/distrib/sets Remove time= keywords from METALOG.sanitised.



details:   https://anonhg.NetBSD.org/src/rev/9994f4307b68
branches:  trunk
changeset: 326265:9994f4307b68
user:      apb <apb%NetBSD.org@localhost>
date:      Thu Jan 23 21:45:27 2014 +0000

description:
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.

diffstat:

 distrib/sets/Makefile |  33 ++++++++++++++++-----------------
 1 files changed, 16 insertions(+), 17 deletions(-)

diffs (62 lines):

diff -r 7f966ef78711 -r 9994f4307b68 distrib/sets/Makefile
--- a/distrib/sets/Makefile     Thu Jan 23 21:37:09 2014 +0000
+++ b/distrib/sets/Makefile     Thu Jan 23 21:45:27 2014 +0000
@@ -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 @@
 # 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 @@
 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} \
+           ${${MKUPDATE} != "no" :? ${METALOG_REMOVE_DUPLICATES} | :} \
+           sort | ${TOOL_MTREE} -CSM -k all -R time -N ${NETBSDSRCDIR}/etc \
            >${METALOG}.new
-.else
-           sort ${METALOG} | ${TOOL_MTREE} -CSM -k all -N ${NETBSDSRCDIR}/etc \
-           >${METALOG}.new
-.endif
        mv ${METALOG}.new ${METALOG}.sanitised
 .if defined(RCSMETALOG)
        . ./metalog.subr; \



Home | Main Index | Thread Index | Old Index