Date: Mon, 14 Aug 2006 14:54:05 +0200 From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: Ruslan Ermilov <ru@FreeBSD.org> Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, Alexander Leidinger <netchild@FreeBSD.org>, cvs-all@FreeBSD.org, Kris Kennaway <kris@obsecurity.org> Subject: Re: cvs commit: src ObsoleteFiles.inc Message-ID: <86y7trtr4i.fsf@xps.des.no> In-Reply-To: <20060814121415.GA59023@rambler-co.ru> (Ruslan Ermilov's message of "Mon, 14 Aug 2006 16:14:15 %2B0400") References: <200608101942.k7AJgOrB051336@repoman.freebsd.org> <20060811235619.G93570@atlantis.atlantis.dp.ua> <20060811220244.GC5237@rambler-co.ru> <20060811223642.GA21117@xor.obsecurity.org> <20060812005213.384b744b@Magellan.Leidinger.net> <20060812084253.GA8597@rambler-co.ru> <20060812123531.GA36569@xor.obsecurity.org> <20060813185551.GA15783@rambler-co.ru> <864pwfwpnm.fsf@xps.des.no> <20060814121415.GA59023@rambler-co.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Ruslan Ermilov <ru@FreeBSD.org> writes:
> "Dag-Erling Smørgrav" <des@des.no> writes:
> > BTW, if you just need to ensure that a file exists, a safe alternative
> > to 'touch ${FILE}' is ':>>${FILE}'. Makefiles in src/sys/modules
> > which use touch should probably be updated to use this instead.
> Very good, I like it.
See attached patch. I ended up using :> instead of :>> since that is
what is meant in most cases (i.e. the file is supposed to be empty)
DES
--
Dag-Erling Smørgrav - des@des.no
[-- Attachment #2 --]
Index: sys/conf/kern.post.mk
===================================================================
RCS file: /home/ncvs/src/sys/conf/kern.post.mk,v
retrieving revision 1.95
diff -u -r1.95 kern.post.mk
--- sys/conf/kern.post.mk 18 Jun 2006 17:48:45 -0000 1.95
+++ sys/conf/kern.post.mk 14 Aug 2006 12:50:05 -0000
@@ -132,7 +132,7 @@
# in the a.out ld. For now, this works.
HACK_EXTRA_FLAGS?= -shared
hack.So: Makefile
- touch hack.c
+ :> hack.c
${CC} ${HACK_EXTRA_FLAGS} -nostdlib hack.c -o hack.So
rm -f hack.c
Index: sys/conf/kmod.mk
===================================================================
RCS file: /home/ncvs/src/sys/conf/kmod.mk,v
retrieving revision 1.209
diff -u -r1.209 kmod.mk
--- sys/conf/kmod.mk 30 Jun 2006 19:35:35 -0000 1.209
+++ sys/conf/kmod.mk 14 Aug 2006 12:51:14 -0000
@@ -192,7 +192,7 @@
.if defined(EXPORT_SYMS)
.if ${EXPORT_SYMS} != YES
.if ${EXPORT_SYMS} == NO
- touch export_syms
+ :> export_syms
.elif !exists(${.CURDIR}/${EXPORT_SYMS})
echo ${EXPORT_SYMS} > export_syms
.else
@@ -311,7 +311,7 @@
CLEANFILES+= ${_src}
.if !target(${_src})
${_src}:
- touch ${.TARGET}
+ :> ${.TARGET}
.endif
.endfor
.endif
Index: sys/conf/newvers.sh
===================================================================
RCS file: /home/ncvs/src/sys/conf/newvers.sh,v
retrieving revision 1.72
diff -u -r1.72 newvers.sh
--- sys/conf/newvers.sh 19 Aug 2005 03:56:45 -0000 1.72
+++ sys/conf/newvers.sh 14 Aug 2006 12:50:47 -0000
@@ -83,7 +83,7 @@
echo 0 > version
fi
-touch version
+:>> version
v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date`
i=`${MAKE:-make} -V KERN_IDENT`
cat << EOF > vers.c
Index: sys/modules/if_ef/Makefile
===================================================================
RCS file: /home/ncvs/src/sys/modules/if_ef/Makefile,v
retrieving revision 1.13
diff -u -r1.13 Makefile
--- sys/modules/if_ef/Makefile 24 Feb 2006 12:27:09 -0000 1.13
+++ sys/modules/if_ef/Makefile 14 Aug 2006 12:47:29 -0000
@@ -19,16 +19,16 @@
#ETHER_SNAP=
opt_inet.h:
- echo "#define INET 1" > opt_inet.h
+ echo "#define INET 1" > ${.TARGET}
opt_ipx.h:
- echo "#define IPX 1" > opt_ipx.h
+ echo "#define IPX 1" > ${.TARGET}
opt_ef.h:
- touch opt_ef.h
+ :> ${.TARGET}
.for frame in ETHER_II ETHER_8023 ETHER_8022 ETHER_SNAP
.if defined(${frame})
- echo "#define ${frame} 1" >> opt_ef.h
+ echo "#define ${frame} 1" >> ${.TARGET}
.endif
.endfor
.endif
Index: sys/modules/if_ppp/Makefile
===================================================================
RCS file: /home/ncvs/src/sys/modules/if_ppp/Makefile,v
retrieving revision 1.35
diff -u -r1.35 Makefile
--- sys/modules/if_ppp/Makefile 27 Feb 2006 16:56:22 -0000 1.35
+++ sys/modules/if_ppp/Makefile 14 Aug 2006 12:48:11 -0000
@@ -20,18 +20,20 @@
.endif
.if !defined(KERNBUILDDIR)
-.if ${PPP_INET} > 0
opt_inet.h:
+ :> ${.TARGET}
+.if ${PPP_INET} > 0
echo "#define INET 1" >> ${.TARGET}
.endif
-.if ${PPP_IPX} > 0
opt_ipx.h:
+ :> ${.TARGET}
+.if ${PPP_IPX} > 0
echo "#define IPX ${PPP_IPX}" >> ${.TARGET}
.endif
opt_ppp.h:
- touch ${.TARGET}
+ :> ${.TARGET}
.if ${PPP_BSDCOMP} > 0
echo "#define PPP_BSDCOMP ${PPP_BSDCOMP}" >> ${.TARGET}
.endif
Index: sys/modules/netgraph/mppc/Makefile
===================================================================
RCS file: /home/ncvs/src/sys/modules/netgraph/mppc/Makefile,v
retrieving revision 1.13
diff -u -r1.13 Makefile
--- sys/modules/netgraph/mppc/Makefile 14 Oct 2005 23:30:13 -0000 1.13
+++ sys/modules/netgraph/mppc/Makefile 14 Aug 2006 12:48:18 -0000
@@ -20,7 +20,7 @@
.if !defined(KERNBUILDDIR)
opt_netgraph.h:
- touch ${.TARGET}
+ :> ${.TARGET}
.if ${NETGRAPH_MPPC_COMPRESSION} > 0
echo "#define NETGRAPH_MPPC_COMPRESSION 1" >> ${.TARGET}
.endif
Index: sys/modules/sound/sound/Makefile
===================================================================
RCS file: /home/ncvs/src/sys/modules/sound/sound/Makefile,v
retrieving revision 1.18
diff -u -r1.18 Makefile
--- sys/modules/sound/sound/Makefile 27 May 2006 16:32:05 -0000 1.18
+++ sys/modules/sound/sound/Makefile 14 Aug 2006 12:48:58 -0000
@@ -22,7 +22,7 @@
# existing one from KERNBUILDDIR which possibly has DEV_ISA defined so
# sound.ko is always built without isadma support.
opt_isa.h:
- touch ${.TARGET}
+ :> ${.TARGET}
.else
SRCS+= sndbuf_dma.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86y7trtr4i.fsf>
