summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2019-01-23 21:20:47 +0100
committerWolfram Sang <wsa+renesas@sang-engineering.com>2019-01-23 21:36:00 +0100
commit9f0140d45a788ce509eeeed4a4bd6d0ddf356a18 (patch)
tree00bbcdbd4ace53795573a0e90fb0cee21adf2e1f /scripts
parent54b6f6430b35d73507b0dcbfac9f85074c670e39 (diff)
scripts/periupport_conv: preserve ':' in comments
Done by staying with ' ' as FS. Suggested-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/periupport_conv20
1 files changed, 9 insertions, 11 deletions
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
}
}
}