Blame po/insert-header.sin

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