Blame po/insert-header.sin

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