Blame po/insert-header.sin

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