On Tuesday 07 March 2006 09:54, Jens Seidel wrote: > It looks like this is already matched by $filter, isn't it? Even if it > is used for different actions it may be useful to create a new filter > based on the old one. Just use it: Hmm. It appears you are completely correct. It looks like the current filter is just broken, mainly by the "$" at the end... I was confused by the fact that comments are currently not excluded in practice and failed to see through the complexity of the current code correctly. So, Christian, maybe it is better to look into the history of the filter a bit instead of adding on new code. If the modified filter below is used, we are left with _only_ the msgid and msgstr lines and all headers and comments are removed. filter="((PO-Revision-Date|Project-Id-Version|Report-Msgid-Bugs-To| POT-Creation-Date|Last-Translator|Language-Team|MIME-Version| Content-Type|Content-Transfer-Encoding|X-Generator|Plural-Forms):|^#[^,]| ^#$)" The last two options effectively say "all commented lines, except if they start with #,". However, the Content-Type header (and maybe some of the others like MIME-Version and Content-Transfer-Encoding) should definitely _not_ be ignored. I also agree with not ignoring Plural-Forms. Also, the check for the headers can be made a bit more specific. So we should probably end up with: filter="^(\"(PO-Revision-Date|Project-Id-Version|Report-Msgid-Bugs-To| POT-Creation-Date|Last-Translator|Language-Team|X-Generator):|#[^,]|#$)" egrep -v "$filter" $lang.po >$oldfiltered egrep -v "$filter" $lang.po.new >$newfiltered if [ -z "$(diff $lang.po $lang.po.new)" ] ; then
Attachment:
pgpDL7s_ImmFS.pgp
Description: PGP signature