Blame po/insert-header.sin

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