Blame po/insert-header.sin

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