From 95239ab73c522cc8458742a243323ff0a059736d Mon Sep 17 00:00:00 2001 From: =?utf8?q?K=C3=A9vin=20THIERRY?= Date: Mon, 2 Jun 2014 11:07:01 +0200 Subject: [PATCH] Add a script to generate the project list MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The script generates the list of projects in a wiki table. Projects are organized in three sections: * Tizen projects * Yocto projects with Tizen patchs * Yocto projects Signed-off-by: Kévin THIERRY --- tools/create-wiki-table_project-list.sh | 66 +++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 tools/create-wiki-table_project-list.sh diff --git a/tools/create-wiki-table_project-list.sh b/tools/create-wiki-table_project-list.sh new file mode 100755 index 0000000..15147f9 --- /dev/null +++ b/tools/create-wiki-table_project-list.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +help() +{ + echo "Usage: $0 " + echo "Example: /poky/build/tmp/buildstats///" + echo "Requires: spec2yocto (https://github.com/eurogiciel-oss/yoctoTizen)" +} + +print_table() +{ + echo "{| class=\"wikitable\"" + echo " | '''Projects from Tizen''' || '''Projects from Yocto with Tizen patchs''' || '''Projects from Yocto'''" + echo " |-" + echo ${TIZEN} + echo ${YOCTO_TIZEN} + echo ${YOCTO} + echo " |}" +} + +main() +{ + spec2yocto generateBuildStatus ${BUILDSTATS_DIR} | cut -f 1,2 | uniq > ${TMP_FILE} + echo ${TIZEN_PROJECTS} > ${TMP_TIZEN_PROJECTS} + + while read LINE + do + local TYPE=$(echo ${LINE} | cut -f 2 -d ' ') + local PROJECT=$(echo ${LINE} | cut -f 1 -d ' ' | grep -v "\-native") + if [ -n "${PROJECT}" ] + then + if [ "${TYPE}" == "git" ] + then + TIZEN="${TIZEN}${PROJECT}
" + elif [ $(grep -c " ${PROJECT} " ${TMP_TIZEN_PROJECTS}) -gt 0 ] + then + YOCTO_TIZEN="${YOCTO_TIZEN} ${PROJECT}
" + else + YOCTO="${YOCTO} ${PROJECT}
" + fi + fi + done < ${TMP_FILE} + + print_table +} + +if [ "$#" -ne 1 ] +then + help + exit 0 +fi + +BUILDSTATS_DIR=$1 + +TMP_FILE=$(mktemp) +TMP_TIZEN_PROJECTS=$(mktemp) + +trap "rm -f ${TMP_FILE} ${TMP_TIZEN_PROJECTS}" EXIT + +TIZEN_PROJECTS="BEGIN weston dbus linux-yocto END" + +TIZEN=" | " +YOCTO=" | " +YOCTO_TIZEN=" | " + +main -- 2.7.4