Blame po/insert-header.sin

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