Blame po/insert-header.sin

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