summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2018-12-12 23:56:46 +0100
committerWolfram Sang <wsa+renesas@sang-engineering.com>2018-12-13 00:01:00 +0100
commitd780432aaacb92ccc98b5c690200071551fd4ecb (patch)
tree6c10cc0043e21b4b6e627c6f68d42ac46890f0c0
parentc0b4dd6eef318ae97c652075077b30dfbef6dbac (diff)
scripts: add import tool for periperlist todo files
Usage: peripelist_conv <source todo> <dest path> <groupname> Example usage for converting the IO todo file: $ scripts/peripelist_conv ../peripelist/io/todo projects/linux/io/ IO Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
-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