Blame po/insert-header.sin

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