From 9f0140d45a788ce509eeeed4a4bd6d0ddf356a18 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Wed, 23 Jan 2019 21:20:47 +0100 Subject: scripts/periupport_conv: preserve ':' in comments Done by staying with ' ' as FS. Suggested-by: Laurent Pinchart Signed-off-by: Wolfram Sang --- scripts/periupport_conv | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'scripts/periupport_conv') diff --git a/scripts/periupport_conv b/scripts/periupport_conv index aa1956d..987f059 100755 --- a/scripts/periupport_conv +++ b/scripts/periupport_conv @@ -8,14 +8,14 @@ DST="$2" # FIXME: ensure this is not already existing in another task uuid_cmd="cat /proc/sys/kernel/random/uuid" -gawk -F: -v dst="$DST" -v cmd="$uuid_cmd" ' +gawk -v dst="$DST" -v cmd="$uuid_cmd" ' function make_filename(nam) { gsub(/[: /]+/, "_", nam) sub(/_$/, "", nam) return nam } - $1 == "B" { - bsp_id = $2 + /^B: / { + bsp_id = substr($0, 4, 40) desc = substr($0, 46) bsp_desc[bsp_id] = desc match(desc, /.*:/) @@ -24,19 +24,17 @@ gawk -F: -v dst="$DST" -v cmd="$uuid_cmd" ' tasks[task_key][bsp_id] = bsp_id } - $1 == "U" { - upstream[bsp_id] = $2 + /^U: / { + upstream[bsp_id] = substr($0, 4, 40) upstream_desc[bsp_id] = substr($0, 46) } - $1 == "*" { $1 = ""; gsub(/"/, "´"); comment[bsp_id] = $0 } + /^*: / { gsub(/"/, "´"); comment[bsp_id] = substr($0, 4) } /^Priority: N/ { exit } END { - FS = " " for (task in tasks) { - cmd | getline uuid; close(cmd); F = dst "/" make_filename(task) ".yaml" @@ -53,7 +51,7 @@ gawk -F: -v dst="$DST" -v cmd="$uuid_cmd" ' print "bsp-commits:" >> F for (idx in sorted_idx) { commit = tasks[task][sorted_idx[idx]] - print " -" commit >> F + print " - " commit >> F print " # " bsp_desc[commit] >> F } print "" >> F @@ -62,7 +60,7 @@ gawk -F: -v dst="$DST" -v cmd="$uuid_cmd" ' for (idx in sorted_idx) { commit = tasks[task][sorted_idx[idx]] if (upstream[commit]) - print " - torvalds:" upstream[commit] " # " upstream_desc[commit] >> F + print " - torvalds: " upstream[commit] " # " upstream_desc[commit] >> F } print "" >> F @@ -70,7 +68,7 @@ gawk -F: -v dst="$DST" -v cmd="$uuid_cmd" ' for (idx in sorted_idx) { commit = tasks[task][sorted_idx[idx]] if (comment[commit]) - print " - \"" substr(commit, 2) ":" substr(comment[commit], 2) "\"" >> F + print " - \"" commit ": " comment[commit] "\"" >> F } } } -- cgit v1.2.3