Blame po/insert-header.sin

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