From d780432aaacb92ccc98b5c690200071551fd4ecb Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Wed, 12 Dec 2018 23:56:46 +0100 Subject: scripts: add import tool for periperlist todo files Usage: peripelist_conv Example usage for converting the IO todo file: $ scripts/peripelist_conv ../peripelist/io/todo projects/linux/io/ IO Signed-off-by: Wolfram Sang --- scripts/peripelist_conv | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 scripts/peripelist_conv (limited to 'scripts/peripelist_conv') 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 " && 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 -- cgit v1.2.3