tech-pkg archive

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

Handling newer msgfmt files in NetBSD



        As of at least NetBSD-4.0 the shipped gettext cannot handle newer
        .po files which use context and fuzzy matches features.

        For wip/ktorrent3 I wrote a nasty little awk script which
        just strips out those entries, which gets us a build.

        Does anyone have any thoughts as to the best way to resolve this?

        --- Nasty awk script below --

# $Id: msgfmtstrip,v 1.1 2008/03/05 13:16:50 absd Exp $
# Simple awk script to strip out .po entries with "msgctxt" or "#~|", so # the resultant file can be handled by the msgfmt 0.14.4 in NetBSD 4.0
{
if (/^$/) { entry_end(); }
else if ($1 == "msgctxt" || $2 == "msgctxt") { skip = 1; }
else if ($1 == "#~|") { skip = 1; }
else { entry = entry $0 "\n" }
}

END { entry_end(); }

function entry_end() {
    if (!skip)
        print entry;
    entry = "";
    skip = 0;
}


--
                           David Brownlee -- abs%absd.org@localhost


Home | Main Index | Thread Index | Old Index