<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/env perl

if (open F, '-|', 'find', $ARGV[0] || '.', '-type', 'f', '-name', '*.po') {
	while (defined(my $path = readline F)) {
		chomp $path;

		(my $ref = $path) =~ s/\.po$/\.master.po/;

		printf 'Updating %s ', $path;
		my $returnCode = system("git show --format=\%B 'master:$path' &gt; '$ref'");
		if ( $returnCode == 0 )
		{
			system('msgmerge', '-N', '-o', $path, $ref, $path);
			system('msgattrib', '--no-obsolete', '-o', $path, $path);
		} else {
			print "...failed due to git error.\n";
		}
		unlink($ref);
	}

	close F;
}
</pre></body></html>