Blame po/insert-header.sin

Packit 79f644
# Sed script that inserts the file called HEADER before the header entry.
Packit 79f644
#
Packit 79f644
# At each occurrence of a line starting with "msgid ", we execute the following
Packit 79f644
# commands. At the first occurrence, insert the file. At the following
Packit 79f644
# occurrences, do nothing. The distinction between the first and the following
Packit 79f644
# occurrences is achieved by looking at the hold space.
Packit 79f644
/^msgid /{
Packit 79f644
x
Packit 79f644
# Test if the hold space is empty.
Packit 79f644
s/m/m/
Packit 79f644
ta
Packit 79f644
# Yes it was empty. First occurrence. Read the file.
Packit 79f644
r HEADER
Packit 79f644
# Output the file's contents by reading the next line. But don't lose the
Packit 79f644
# current line while doing this.
Packit 79f644
g
Packit 79f644
N
Packit 79f644
bb
Packit 79f644
:a
Packit 79f644
# The hold space was nonempty. Following occurrences. Do nothing.
Packit 79f644
x
Packit 79f644
:b
Packit 79f644
}