From: Bruno Haible Date: Fri, 14 Feb 2003 13:53:29 +0000 (+0000) Subject: Move po/insert-header.sin to gettext-runtime/po/insert-header.sin and gettext-tools... X-Git-Tag: v0.12~735 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a82b135f685eee8d94481f6b45fb7662fa6ec933;p=thirdparty%2Fgettext.git Move po/insert-header.sin to gettext-runtime/po/insert-header.sin and gettext-tools/po/insert-header.sin. --- diff --git a/po/insert-header.sin b/gettext-runtime/po/insert-header.sin similarity index 100% rename from po/insert-header.sin rename to gettext-runtime/po/insert-header.sin diff --git a/gettext-tools/po/insert-header.sin b/gettext-tools/po/insert-header.sin new file mode 100644 index 000000000..b26de01f6 --- /dev/null +++ b/gettext-tools/po/insert-header.sin @@ -0,0 +1,23 @@ +# Sed script that inserts the file called HEADER before the header entry. +# +# At each occurrence of a line starting with "msgid ", we execute the following +# commands. At the first occurrence, insert the file. At the following +# occurrences, do nothing. The distinction between the first and the following +# occurrences is achieved by looking at the hold space. +/^msgid /{ +x +# Test if the hold space is empty. +s/m/m/ +ta +# Yes it was empty. First occurrence. Read the file. +r HEADER +# Output the file's contents by reading the next line. But don't lose the +# current line while doing this. +g +N +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +}