Blame po/insert-header.sin

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