summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
}
}
}