Blame po/insert-header.sin

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