Blame po/insert-header.sin

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