Module Name:    src
Committed By:   uebayasi
Date:           Wed Feb 16 05:18:35 UTC 2011

Modified Files:
        src/distrib/sets: Makefile
Added Files:
        src/distrib/sets: metalog.subr

Log Message:
Add a hook to version METALOG using rcs(1).


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/distrib/sets/Makefile
cvs rdiff -u -r0 -r1.1 src/distrib/sets/metalog.subr

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.80 src/distrib/sets/Makefile:1.81
--- src/distrib/sets/Makefile:1.80	Sun Aug 15 07:27:33 2010
+++ src/distrib/sets/Makefile	Wed Feb 16 05:18:35 2011
@@ -1,4 +1,8 @@
-#	$NetBSD: Makefile,v 1.80 2010/08/15 07:27:33 mrg Exp $
+#	$NetBSD: Makefile,v 1.81 2011/02/16 05:18:35 uebayasi Exp $
+
+# Experimental RCS METALOG versioning
+# (Needs host's rcs(1) commands)
+#RCSMETALOG=1
 
 # The `all' target must appear before bsd.own.mk is pulled in.
 all:
@@ -120,13 +124,26 @@
 	${TOOL_MTREE} -CSM -k all -N ${NETBSDSRCDIR}/etc <${METALOG} \
 	    >${METALOG}.new
 	mv ${METALOG}.new ${METALOG}.sanitised
+.if defined(RCSMETALOG)
+	. ./metalog.subr; \
+	xrcs_descr="build distribution METALOG"; \
+	xrcs_msg="$$(date)"; \
+	xrcs_cur=${METALOG}.sanitised; \
+	xrcs update
+.endif
 .if ${MKUPDATE} == "no" || !exists(${METALOG})
 clean_METALOG: .PHONY
 	rm -f ${METALOG} ${METALOG}.*
 .else	# MKUPDATE
 clean_METALOG: .PHONY ${METALOG}.sanitised
 	mv ${METALOG}.sanitised ${METALOG}
+.if defined(RCSMETALOG)
+	mv ${METALOG}.sanitised,v ${METALOG},v
+.endif
 	rm -f ${METALOG}.*
+.if defined(RCSMETALOG)
+	mv ${METALOG},v ${METALOG}.sanitised,v
+.endif
 .endif	# MKUPDATE
 .endif	# MKUNPRIVED
 

Added files:

Index: src/distrib/sets/metalog.subr
diff -u /dev/null src/distrib/sets/metalog.subr:1.1
--- /dev/null	Wed Feb 16 05:18:35 2011
+++ src/distrib/sets/metalog.subr	Wed Feb 16 05:18:35 2011
@@ -0,0 +1,73 @@
+# $NetBSD: metalog.subr,v 1.1 2011/02/16 05:18:35 uebayasi Exp $
+
+#
+# xrcs add
+# xrcs update
+# xrcs remove
+#
+#	RCS wrapper for non-interactive scripts.
+#	Excerpted from /etc/security.
+#
+
+xrcs_descr=
+xrcs_msg=
+xrcs_cur=
+xrcs_new=
+
+xrcs_unlock()
+{
+	rcs -q -u -U -M ${xrcs_cur}
+}
+
+xrcs_ci()
+{
+	ci -q -f -u -t-"$xrcs_descr" -m"$xrcs_msg" ${xrcs_cur}
+	rcs -q -kb -U ${xrcs_cur}
+}
+
+xrcs_co()
+{
+	co -q -f -u ${xrcs_cur}
+}
+
+xrcs_init()
+{
+	if [ -f ${xrcs_cur},v ]; then
+		xrcs_unlock
+	fi
+
+	if [ -f ${xrcs_cur} ]; then
+		if [ ! -f ${xrcs_cur},v ]; then
+			xrcs_ci
+			xrcs_co
+		fi
+	fi
+}
+
+xrcs_add()
+{
+	xrcs_init
+	cp -p $1 ${xrcs_cur}
+	xrcs_ci
+	xrcs_co
+}
+
+xrcs_update()
+{
+	xrcs_init
+	xrcs_ci
+	xrcs_co
+}
+
+xrcs_remove()
+{
+	xrcs_init
+	cp /dev/null ${xrcs_cur}
+	xrcs_ci
+	rm ${xrcs_cur}
+}
+
+xrcs()
+{
+	eval xrcs_$1
+}

Reply via email to