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)
This commit is contained in:
jilles 2013-09-17 20:09:25 +00:00
parent 3f1242f97f
commit 8e8d9f528b
2 changed files with 20 additions and 16 deletions

View File

@ -7,10 +7,11 @@ SUBDIR= APPLE AST BIG5 CNS CP EBCDIC GB GEORGIAN ISO646 ISO-8859 JIS \
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}

View File

@ -10,18 +10,20 @@ FILES+= esdb.dir esdb.dir.db esdb.alias esdb.alias.db
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}