From: Thomas Petazzoni Date: Tue, 31 Jul 2012 19:32:25 +0000 (+0200) Subject: pkg-stats: add license information, rework information displayed X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1ed1a83f1c415a77ab23f74c7a909f331319facd;p=buildroot.git pkg-stats: add license information, rework information displayed Now that most packages have been converted over to package infrastructures, keep only one column to show the package infrastructures. A new column, showing of the package has license information, has been added. This will help in increasing the number of packages having license metadata. Signed-off-by: Thomas Petazzoni --- diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats index ac5d8ec844..ca2d0ec5d4 100755 --- a/support/scripts/pkg-stats +++ b/support/scripts/pkg-stats @@ -36,53 +36,65 @@ td { td.centered { text-align: center; } -tr.wrong td { +td.wrong { background: #ff9a69; } -tr.correct td { +td.correct { background: #d2ffc4; } +td.nopatches { + background: #d2ffc4; +} + +td.somepatches { + background: #ffd870; +} + +td.lotsofpatches { + background: #ff9a69; +} +Statistics of Buildroot packages Results
- - - - - - - - + + + + + - - - - - - - - - -" - -convert_to_generic_target=0 -convert_to_generic_host=0 -convert_to_target_autotools=0 -convert_to_host_autotools=0 +" + +autotools_packages=0 +cmake_packages=0 +generic_packages=0 +manual_packages=0 +packages_with_licence=0 +packages_without_licence=0 total_patch_count=0 cnt=0 -for i in $(find package/ -name '*.mk') ; do + +for i in $(find boot/ linux/ package/ -name '*.mk' | sort) ; do if test \ + $i = "boot/common.mk" -o \ + $i = "linux/linux-ext-xenomai.mk" -o \ + $i = "linux/linux-ext-rtai.mk" -o \ + $i = "linux/linux-ext-ocf-linux.mk" -o \ $i = "package/efl/efl.mk" -o \ $i = "package/games/games.mk" -o \ $i = "package/gtk2-themes/gtk2-themes.mk" -o \ $i = "package/multimedia/multimedia.mk" -o \ - $i = "package/customize/customize.mk" -o \ + $i = "package/customize/customize.mk" -o \ + $i = "package/pkg-autotools.mk" -o \ + $i = "package/pkg-cmake.mk" -o \ + $i = "package/pkg-generic.mk" -o \ + $i = "package/pkg-utils.mk" -o \ + $i = "package/pkg-download.mk" -o \ $i = "package/matchbox/matchbox.mk" -o \ $i = "package/x11r7/x11r7.mk" ; then echo "skipping $i" 1>&2 @@ -91,78 +103,67 @@ for i in $(find package/ -name '*.mk') ; do cnt=$((cnt+1)) - is_auto_host=0 - is_auto_target=0 - is_cmake_host=0 - is_cmake_target=0 - is_pkg_target=0 - is_pkg_host=0 - is_manual_target=0 - is_manual_host=0 + hashost=0 + hastarget=0 + # Determine package infrastructure if grep -E "\(host-autotools-package\)" $i > /dev/null ; then - is_auto_host=1 + infratype="autotools" + hashost=1 fi if grep -E "\(autotools-package\)" $i > /dev/null ; then - is_auto_target=1 + infratype="autotools" + hastarget=1 fi if grep -E "\(host-generic-package\)" $i > /dev/null ; then - is_pkg_host=1 + infratype="generic" + hashost=1 fi if grep -E "\(generic-package\)" $i > /dev/null ; then - is_pkg_target=1 + infratype="generic" + hastarget=1 fi if grep -E "\(host-cmake-package\)" $i > /dev/null ; then - is_cmake_host=1 + infratype="cmake" + hashost=1 fi if grep -E "\(cmake-package\)" $i > /dev/null ; then - is_cmake_target=1 + infratype="cmake" + hastarget=1 fi pkg=$(basename $i) pkg=${pkg%.mk} + pkgvariable=$(echo ${pkg} | tr "a-z-" "A-Z_") - if grep "^host-$pkg:" $i > /dev/null ; then - is_manual_host=1 - fi - - if test $is_pkg_target -eq 0 -a $is_auto_target -eq 0 -a $is_cmake_target -eq 0; then - is_manual_target=1 - fi - - tasks="" - - if [ $is_manual_target -eq 1 ] ; then - if grep "/configure" $i > /dev/null ; then - tasks=$tasks"
  • convert package to autotools ?
  • " - convert_to_target_autotools=$((convert_to_target_autotools+1)) - else - tasks=$tasks"
  • convert to generic target
  • " - convert_to_generic_target=$((convert_to_generic_target+1)) - fi - fi - if [ $is_manual_host -eq 1 ]; then - if grep "/configure" $i > /dev/null ; then - tasks=$tasks"
  • convert package to autotools ?
  • " - convert_to_host_autotools=$((convert_to_host_autotools+1)) - else - tasks=$tasks"
  • convert to generic host
  • " - convert_to_generic_host=$((convert_to_generic_host+1)) - fi + # Count packages per infrastructure + if [ -z ${infratype} ] ; then + infratype="manual" + manual_packages=$(($manual_packages+1)) + elif [ ${infratype} = "autotools" ]; then + autotools_packages=$(($autotools_packages+1)) + elif [ ${infratype} = "cmake" ]; then + cmake_packages=$(($cmake_packages+1)) + elif [ ${infratype} = "generic" ]; then + generic_packages=$(($generic_packages+1)) fi - if test -n "$tasks" ; then - echo "" + if grep -qE "^${pkgvariable}_LICENSE =" $i ; then + packages_with_license=$(($packages_with_license+1)) + license=1 else - echo "" + packages_without_license=$(($packages_without_license+1)) + license=0 fi + echo "" + echo "" echo "" @@ -171,86 +172,37 @@ for i in $(find package/ -name '*.mk') ; do total_patch_count=$(($total_patch_count+$patch_count)) if test $patch_count -lt 1 ; then - patch_count_color="#00ff00" + patch_count_class="nopatches" elif test $patch_count -lt 5 ; then - patch_count_color="#ffc600" - else - patch_count_color="#ff0000" - fi - - echo "" - - echo "" - echo "" - echo "" else - echo "NO" - fi - echo "" - - echo "" - - echo "" - - echo "" - - echo "" fi - echo "" - echo "" else - echo "NO" + echo "" fi - echo "" - - echo "" echo "" @@ -259,20 +211,28 @@ echo "
    IdPackagePatch countautotools-packagegeneric-packagecmake-packagemanualActionsIdPackagePatch countInfrastructureLicense
    hosttargethosttargethosttargethosttarget
    $cnt$i" - echo $patch_count - echo "" - if [ $is_auto_host -eq 1 ] ; then - echo "YES" + patch_count_class="somepatches" else - echo "NO" + patch_count_class="lotsofpatches" fi - echo "" - if [ $is_auto_target -eq 1 ] ; then - echo "YES" - else - echo "NO" - fi + echo "" + echo "$patch_count" echo "" - if [ $is_pkg_host -eq 1 ] ; then - echo "YES" + if [ ${infratype} = "manual" ] ; then + echo "manual" - if [ $is_pkg_target -eq 1 ] ; then - echo "YES" - else - echo "NO" - fi - echo "" - if [ $is_cmake_host -eq 1 ] ; then - echo "YES" - else - echo "NO" - fi - echo "" - if [ $is_cmake_target -eq 1 ] ; then - echo "YES" - else - echo "NO" - fi - echo "" - if [ $is_manual_host -eq 1 ] ; then - echo "YES" - else - echo "NO" + echo "" + echo "${infratype}
    " + if [ ${hashost} -eq 1 -a ${hastarget} -eq 1 ]; then + echo "target + host" + elif [ ${hashost} -eq 1 ]; then + echo "host" + else + echo "target" + fi + echo "
    " - if [ $is_manual_target -eq 1 ] ; then - echo "YES" + if [ ${license} -eq 0 ] ; then + echo "NoYes" - echo "
      " - echo $tasks - echo "
    " - echo "
    " echo "" echo "" -echo "" -echo "" +echo "" +echo "" +echo "" +echo "" +echo "" +echo "" echo "" echo "" -echo "" -echo "" +echo "" +echo "" echo "" echo "" -echo "" -echo "" +echo "" +echo "" echo "" echo "" -echo "" -echo "" +echo "" +echo "" +echo "" +echo "" +echo "" +echo "" echo "" echo "" echo "" @@ -283,3 +243,8 @@ echo "" echo "" echo "" echo "
    Packages to convert to generic target$convert_to_generic_targetPackages using the generic infrastructure$generic_packages
    Packages using the cmake infrastructure$cmake_packages
    Packages to convert to generic host$convert_to_generic_hostPackages using the autotools infrastructure$autotools_packages
    Packages to convert to target autotools$convert_to_target_autotoolsPackages not using any infrastructure$manual_packages
    Packages to convert to host autotools$convert_to_host_autotoolsPackages having license information$packages_with_license
    Packages not having licence information$packages_without_license
    Number of patches in all packagesTOTAL$cnt
    " + +echo "
    " +echo "Updated on $(LANG=C date), Git commit $(git log master -n 1 --pretty=format:%H)" +echo "" +echo "" \ No newline at end of file