BEGIN {
in_record = 1
bug_num = 0
}
{
if ($1 ~ /^\%\% *$/) {
# print "RECORD END"
if (length(bug_status) == 0) {
bug_status = "open"
}
if (length(bug_has_image) == 0) {
pr_image_str = ""
}
else {
pr_image_str = "image: " bug_has_image ""
}
print "
"
print "
#" bug_num " " bug_title ""
print "
status: " bug_status " " pr_image_str ""
print "
" bug_descr ""
print "
"
print "
"
}
if ($1 == "Bug:") {
sub(/^Bug: /, "", $0)
bug_title = $0
in_record = 2
bug_has_image = ""
bug_descr = ""
bug_status = ""
bug_num = bug_num + 1
}
else if ($1 == "Image:") {
bug_has_image = $2
}
else if ($1 == "Status:") {
bug_status = $2
}
else {
if (in_record == 2) {
if (length(bug_descr) > 0) {
if (length($0) == 0) {
bug_descr = bug_descr "
"
}
else {
bug_descr = bug_descr " " $0
}
}
else {
bug_descr = $0
}
}
}
}