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

[PATCH] Force to write trace file date with LANG=POSIX

  If locale environment variables (LANG, LC_ALL etc..) are set,
new ftpsync script are write logs trace etc.. under this locales.

  But I think it is better force to write trace file (typicaly
project/trace/HOSTNAME) with POSIX locale (or C) (not locale
language environment).

  Mirror trace file will be used tracking mirror tree status.
  Trace file is mainly used to parse them by some programs,
 (mainly not for reading by a human)

  If date in the trace file is written with locale language environmet
on each different host. It is too hard to perse them on each host
(for example, trace file on ftp.jp.debian.org is written in
Japanese, on ftp.kr.debian.org written in Korean, on ftp.de.debian.org
written in German... It will be nightmare for tracing mirror tree)

Signed-off-by: ISHIKAWA Mutsumi <ishikawa@hanzubon.jp>
 bin/ftpsync |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bin/ftpsync b/bin/ftpsync
index fc8e6f3..1ace715 100755
--- a/bin/ftpsync
+++ b/bin/ftpsync
@@ -437,7 +437,7 @@ while [ -e "${UPDATEREQUIRED}" ]; do
 if [ -d "`dirname "${TO}/${TRACE}"`" ]; then
-      date -u > "${TO}/${TRACE}"
+      LC_ALL=POSIX LANG=POSIX date -u > "${TO}/${TRACE}"
       echo "Used ftpsync version: ${VERSION}" >> "${TO}/${TRACE}"
 	  echo "Running on host: $(hostname -f)" >> "${TO}/${TRACE}"

 <ishikawa@debian.org>, <ishikawa@hanzubon.jp>, <ishikawa@osdn.jp>

Reply to: