summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/peripelist_conv35
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/peripelist_conv b/scripts/peripelist_conv
new file mode 100755
index 0000000..5626a6e
--- /dev/null
+++ b/scripts/peripelist_conv
@@ -0,0 +1,35 @@
+#! /bin/sh
+
+[ $# -ne 3 ] && echo "$0 <source todo> <dest path> <groupname>" && exit 0
+
+SRC="$1"
+DST="$2"
+GRP="$3"
+
+# FIXME: ensure this is not already existing in another task
+uuid_cmd="cat /proc/sys/kernel/random/uuid"
+
+awk -F, -v team="$GRP" -v dst="$DST" -v cmd="$uuid_cmd" '
+ BEGIN {
+ status["noplan"] = status["plan"] = "New"
+ status["public"] = status["prototype"] = "Active"
+ status["merged"] = status["complete"] = "Done"
+ date["v4.21"] = "2018-12-31"
+ date["?"] = ""
+ }
+ /^[^#]/ {
+ cmd | getline uuid; close(cmd);
+ F=dst "/" uuid ".yaml"
+ print "title: " $1 "; " $5 > F
+ print "team: " team >> F
+ print "key: " uuid >> F
+ if ($4 != "?") print "assignee: " toupper(substr($4, 1, 1)) tolower(substr($4, 2)) >> F
+ print "status: " status[$3] >> F
+ if ($2 != "?") print "target-date: " ($2 in date ? date[$2] : $2) >> F
+ print "" >> F
+ print "relationships:\n" >> F
+ print "bsp-commits:\n" >> F
+ print "upstream:\n" >> F
+ print "comments:\n" >> F
+ }
+' $SRC