From: Thomas Petazzoni Date: Tue, 27 Oct 2009 23:28:40 +0000 (+0100) Subject: Add package statistics script X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=35e635b7ddfdcfac562eaf44809f2ffca119a23a;p=buildroot.git Add package statistics script Signed-off-by: Thomas Petazzoni --- diff --git a/scripts/pkg-stats b/scripts/pkg-stats new file mode 100755 index 0000000000..0ed420d325 --- /dev/null +++ b/scripts/pkg-stats @@ -0,0 +1,200 @@ +#!/bin/bash + +# Copyright (C) 2009 by Thomas Petazzoni +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# This script generates an HTML file that contains a report about all +# Buildroot packages, their usage of the different package +# infrastructure and possible cleanup actions +# +# Run the script from the Buildroot toplevel directory: +# +# ./scripts/pkg-stats > /tmp/pkg.html +# + +echo " + + + +Results
+ + + + + + + + + + + + + + + + + +" + +convert_to_generic_target=0 +convert_to_generic_host=0 +convert_to_autotools=0 +cnt=1 +for i in $(find package/ -name '*.mk') ; do + + if test $i = "package/mtd/mtd.mk" -o \ + $i = "package/java/java.mk" -o \ + $i = "package/database/database.mk" -o \ + $i = "package/editors/editors.mk" -o \ + $i = "package/games/games.mk" -o \ + $i = "package/multimedia/multimedia" -o \ + $i = "package/customize/customize.mk" -o \ + $i = "package/gnuconfig/gnuconfig.mk" -o \ + $i = "package/x11r7/x11r7.mk" ; then + echo "skipping $i" 1>&2 + continue + fi + + found=0 + + echo "" + echo "" + cnt=$((cnt+1)) + echo "" + + is_auto_host=0 + is_auto_target=0 + is_pkg_target=0 + is_pkg_host=0 + is_manual_target=0 + is_manual_host=0 + + echo "" + + echo "" + + echo "" + + pkg=$(basename $i) + pkg=${pkg%.mk} + + echo "" + + echo "" + + echo "" + + echo "" + +done +echo "
IdPackageAUTOTARGETSGENTARGETSmanualActions
hosttargethosttargethosttarget
$cnt$i" + if grep -E "\(call AUTOTARGETS,[^,]*,[^,]*,host\)" $i > /dev/null ; then + is_auto_host=1 + echo "YES" + else + echo "NO" + fi + + echo "" + if grep -E "\(call AUTOTARGETS,[^,]*,[^,]*(,target|)\)" $i > /dev/null ; then + found=1 + is_auto_target=1 + echo "YES" + else + echo "NO" + fi + echo "" + if grep -E "\(call GENTARGETS,[^,]*,[^,]*,host\)" $i > /dev/null ; then + found=1 + is_pkg_host=1 + echo "YES" + else + echo "NO" + fi + echo "" + if grep -E "\(call GENTARGETS,[^,]*,[^,]*(,target|)\)" $i > /dev/null ; then + found=1 + is_pkg_target=1 + echo "YES" + else + echo "NO" + fi + echo "" + if grep "^host-$pkg:" $i > /dev/null ; then + found=1 + is_manual_host=1 + echo "YES" + else + echo "NO" + fi + echo "" + if grep "^$pkg:" $i > /dev/null ; then + found=1 + is_manual_target=1 + echo "YES" + else + echo "NO" + fi + echo "" + echo "
    " + if [ $is_manual_target -eq 1 ]; then + echo "
  • convert to generic target
  • " + convert_to_generic_target=$((convert_to_generic_target+1)) + fi + if [ $is_manual_host -eq 1 ]; then + echo "
  • convert to generic host
  • " + convert_to_generic_host=$((convert_to_generic_host+1)) + fi + if grep "\./configure" $i > /dev/null ; then + if [ $is_manual_host -ne 1 ] ; then + echo "
  • convert package to autotools ?
  • " + convert_to_autotools=$((convert_to_autotools+1)) + fi + fi + if [ $found -eq 0 ] ; then + echo "
  • look manually
  • " + fi + echo "
" + echo "
" + +echo "" +echo "" +echo "" +echo "" +echo "" +echo "" +echo "" +echo "" +echo "" +echo "" +echo "" +echo "" +echo "" +echo "" +echo "" +echo "" +echo "" +echo "
Packages to convert to generic target$convert_to_generic_target
Packages to convert to generic host$convert_to_generic_host
Packages to convert to autotools$convert_to_autotools
TOTAL$cnt
"