]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Move po/insert-header.sin to gettext-runtime/po/insert-header.sin and gettext-tools...
authorBruno Haible <bruno@clisp.org>
Fri, 14 Feb 2003 13:53:29 +0000 (13:53 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:09:29 +0000 (12:09 +0200)
gettext-runtime/po/insert-header.sin [moved from po/insert-header.sin with 100% similarity]
gettext-tools/po/insert-header.sin [new file with mode: 0644]

diff --git a/gettext-tools/po/insert-header.sin b/gettext-tools/po/insert-header.sin
new file mode 100644 (file)
index 0000000..b26de01
--- /dev/null
@@ -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
+}