csomh / source-git / rpm

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