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