Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Sep 2013 20:09:26 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r255651 - in head/share/i18n: csmapper esdb
Message-ID:  <201309172009.r8HK9QvW061191@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Tue Sep 17 20:09:25 2013
New Revision: 255651
URL: http://svnweb.freebsd.org/changeset/base/255651

Log:
  share/i18n: Fix installworld with read-only obj.
  
  Since iconv was enabled (r254273, August 13), it has been impossible to
  installworld using a read-only obj tree. This is common with NFS. Parts of
  share/i18n unconditionally rebuild files like mapper.dir during
  installation.
  
  This patch ensures the files like mapper.dir are not rewritten with the same
  contents.
  
  Tested by:	joel
  Approved by:	re (hrs)

Modified:
  head/share/i18n/csmapper/Makefile
  head/share/i18n/esdb/Makefile

Modified: head/share/i18n/csmapper/Makefile
==============================================================================
--- head/share/i18n/csmapper/Makefile	Tue Sep 17 18:51:35 2013	(r255650)
+++ head/share/i18n/csmapper/Makefile	Tue Sep 17 20:09:25 2013	(r255651)
@@ -7,10 +7,11 @@ SUBDIR=	APPLE AST BIG5 CNS CP EBCDIC GB 
 	KAZAKH KOI KS MISC TCVN
 
 mapper.dir: ${SUBDIR}
-	> ${.TARGET}
-.for i in ${SUBDIR}
-	cat ${i}/mapper.dir.${i} >> ${.TARGET}
-.endfor
+	newfile=$$(for i in ${SUBDIR}; do \
+		cat $$i/mapper.dir.$$i; \
+	done); \
+	[ "$$newfile" = "$$(cat ${.TARGET} 2>/dev/null)" ] || \
+		printf '%s\n' "$$newfile" >${.TARGET}
 mapper.dir.db: mapper.dir
 	${MKCSMAPPER} -m -o ${.TARGET} ${.ALLSRC}
 
@@ -18,10 +19,11 @@ FILES+=	mapper.dir mapper.dir.db
 CLEANFILES+= mapper.dir mapper.dir.db
 
 charset.pivot: ${SUBDIR}
-	> ${.TARGET}
-.for i in ${SUBDIR}
-	cat ${i}/charset.pivot.${i} >> ${.TARGET}
-.endfor
+	newfile=$$(for i in ${SUBDIR}; do \
+		cat $$i/charset.pivot.$$i; \
+	done); \
+	[ "$$newfile" = "$$(cat ${.TARGET} 2>/dev/null)" ] || \
+		printf '%s\n' "$$newfile" >${.TARGET}
 charset.pivot.pvdb: charset.pivot
 	${MKCSMAPPER} -p -o ${.TARGET} ${.ALLSRC}
 

Modified: head/share/i18n/esdb/Makefile
==============================================================================
--- head/share/i18n/esdb/Makefile	Tue Sep 17 18:51:35 2013	(r255650)
+++ head/share/i18n/esdb/Makefile	Tue Sep 17 20:09:25 2013	(r255651)
@@ -10,18 +10,20 @@ FILES+=	esdb.dir esdb.dir.db esdb.alias 
 CLEANFILES= ${FILES}
 
 esdb.dir: ${SUBDIR}
-	> $@
-.for i in ${SUBDIR}
-	cat ${i}/esdb.dir.${i} >>${.TARGET}
-.endfor
+	newfile=$$(for i in ${SUBDIR}; do \
+		cat $$i/esdb.dir.$$i; \
+	done); \
+	[ "$$newfile" = "$$(cat ${.TARGET} 2>/dev/null)" ] || \
+		printf '%s\n' "$$newfile" >${.TARGET}
 esdb.dir.db: esdb.dir
 	${MKESDB} -m -o ${.TARGET} ${.ALLSRC}
 
 esdb.alias: ${SUBDIR}
-	> $@
-.for i in ${SUBDIR}
-	cat ${i}/esdb.alias.${i} >>${.TARGET}
-.endfor
+	newfile=$$(for i in ${SUBDIR}; do \
+		cat $$i/esdb.alias.$$i; \
+	done); \
+	[ "$$newfile" = "$$(cat ${.TARGET} 2>/dev/null)" ] || \
+		printf '%s\n' "$$newfile" >${.TARGET}
 esdb.alias.db: esdb.alias
 	${MKESDB} -m -o ${.TARGET} ${.ALLSRC}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309172009.r8HK9QvW061191>