root/msgmerge-wrapper.rb

Revision 783ffa4235330029d661752b1023db635b26f2b3, 0.9 KB (checked in by Raine Virta <rane@…>, 18 months ago)

remove whitespace

  • Property mode set to 100755
Line 
1#!/usr/bin/ruby
2# This is a wrapper to msgmerge, it executes msgmerge with the given arguments, and
3# if msgmerge output is empty, prints the content of the file named the first
4# argument. otherwise it prints the output of msgmerge. The wrapper should be
5# "compatible" with the real msgmerge if msgmerge output is non-empty, or if the
6# first argument is the defpo file (instead of an option, or --)
7#
8# The path to msgmerge can be specified in env variable REAL_MSGMERGE_PATH
9#
10# The purpose is to provide a workaround for ruby-gettext, which treats empty output
11# from msgmerge as error in the po file, where it should mean that no modification
12# is needed to the defpo. For updates on the issue follow
13# http://rubyforge.org/pipermail/gettext-users-en/2008-June/000094.html
14
15
16msgmerge = ENV['REAL_MSGMERGE_PATH'] || 'msgmerge'
17defpo = ARGV.shift
18output = `#{msgmerge} #{defpo} #{ARGV.join ' '}`
19output = File.read(defpo) if output.empty?
20STDOUT.write output
21
Note: See TracBrowser for help on using the browser.