Blame po/insert-header.sin

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