Blame po/insert-header.sin

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