{"thread":{"id":"12509","subject":"[PATCH] gitk: Fallback to po2msg if msgfmt is not available","startedAt":"2008-03-05T07:17:38Z","lastAt":"2008-03-05T07:17:38Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"71037","messageId":"20080305071738.GA23079@spearce.org","threadId":"12509","inReplyTo":null,"subject":"[PATCH] gitk: Fallback to po2msg if msgfmt is not available","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-03-05T07:17:38Z","receivedAt":"2008-03-05T07:17:38Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"If msgfmt is not in our PATH, or it is but it does not seem to honor the\n--tcl command line option then we need to fallback to po2msg.  This is\nrather common on Mac OS X systems, but also can show up on a Linux OS\nif GNU gettext is not installed on the system.\n\nThis particular block of code was copied from git-gui's Makefile,\nwhere we have already (reasonably) vetted this fallback system.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n Makefile |    8 ++++++++\n 1 files changed, 8 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex ae2b80b..49a9209 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -22,6 +22,14 @@ ifdef NO_MSGFMT\n \tMSGFMT ?= $(TCL_PATH) po/po2msg.sh\n else\n \tMSGFMT ?= msgfmt\n+\tifeq ($(shell $(MSGFMT) >/dev/null 2>&1 || echo $$?),127)\n+\t\tMSGFMT := $(TCL_PATH) po/po2msg.sh\n+\tendif\n+\tifeq (msgfmt,$(MSGFMT))\n+\tifeq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null || echo $?),1)\n+\t\tMSGFMT := $(TCL_PATH) po/po2msg.sh\n+\tendif\n+\tendif\n endif\n \n PO_TEMPLATE = po/gitk.pot\n-- \n1.5.4.3.529.gb25fb\n"}]}