Blame po/insert-header.sin

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