aboutsummaryrefslogtreecommitdiff
path: root/util/board_status/to-wiki/bucketize.sh
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2013-12-05 18:11:33 +0100
committerPatrick Georgi <patrick@georgi-clan.de>2013-12-05 18:40:25 +0100
commit274c6c2177979ba471f61f03d2ea76df673ff925 (patch)
treecaf296bd0453f0edee9db03be014664a65e629f8 /util/board_status/to-wiki/bucketize.sh
parent08c4150ec4f9fde303205802d646f96a54fd5a59 (diff)
Add scripts to export board status data to wiki
It's a start... Change-Id: Ibdb0b64ab0349df58bcad5ce553bf0dbec636925 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/4483 Tested-by: build bot (Jenkins)
Diffstat (limited to 'util/board_status/to-wiki/bucketize.sh')
-rwxr-xr-xutil/board_status/to-wiki/bucketize.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/util/board_status/to-wiki/bucketize.sh b/util/board_status/to-wiki/bucketize.sh
new file mode 100755
index 0000000000..19a7c77c5e
--- /dev/null
+++ b/util/board_status/to-wiki/bucketize.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+# usage: $0 [weekly|monthly|quarterly] < filenames
+# sorts files of the form VENDOR/BOARD/COMMIT/DATE/revision.txt
+# into buckets of the given granularity
+
+weekly() {
+ date --date="$1" +%YW%V
+}
+
+monthly() {
+ date --date="$1" +%Y-%m
+}
+
+quarterly() {
+ date --date="$1" "+%Y %m" | awk '{ q=int(($2-1)/3+1); print $1 "Q" q}'
+}
+
+# TODO: restrict $1 to allowed values
+
+curr=""
+sort -r -k4 -t/ | while read file; do
+ timestamp=`printf $file | cut -d/ -f4`
+ new=`$1 $timestamp`
+ if [ "$new" != "$curr" ]; then
+ if [ "$curr" != "" ]; then
+ printf "\n"
+ fi
+ printf "$new:"
+ curr=$new
+ fi
+ printf "$file "
+done
+printf "\n"
+