Blame po/insert-header.sin

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