Blame po/insert-header.sin

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