Patchwork [1/1] Create a script for SUMMARY audit in recipes

login
register
mail settings
Submitter Shane Wang
Date Dec. 21, 2011, 4:32 a.m.
Message ID <9b44ef75482f0625eb56d98bed2e491fa2eb7da7.1324441819.git.shane.wang@intel.com>
Download mbox | patch
Permalink /patch/17345/
State New
Headers show

Comments

Shane Wang - Dec. 21, 2011, 4:32 a.m.
Some recipes don't contain SUMMARY, which HOB will use for descriptions.
If the summary is missing, bitbake will create a default value for summary.
That is PN plus string " version " plus its version. Every maintainer should add and update the summary fields according to audit results.

[YOCTO #1804] got fixed, and maintainers should follow up.

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 scripts/contrib/summary-audit.sh |   55 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 55 insertions(+), 0 deletions(-)
 create mode 100755 scripts/contrib/summary-audit.sh

Patch

diff --git a/scripts/contrib/summary-audit.sh b/scripts/contrib/summary-audit.sh
new file mode 100755
index 0000000..63b43cb
--- /dev/null
+++ b/scripts/contrib/summary-audit.sh
@@ -0,0 +1,55 @@ 
+#!/bin/sh
+#
+# Perform an audit of which recipes provide summary and which
+# are missing for HOB2.
+#
+# Setup requirements: Run this script after source'ing the build
+# environment script, so you're running it from build/ directory.
+#
+# Maintainer: Shane Wang <shane.wang@intel.com>
+
+DISTRO_TRACKING_FILE="../meta/conf/distro/include/distro_tracking_fields.inc"
+REPORT_MISSING_SUMMARY="summary.txt"
+REPORT_LOG="summary.log"
+
+rm -rf $REPORT_MISSING_SUMMARY $REPORT_LOG
+
+BITBAKE=`which bitbake`
+if [ -z "$BITBAKE" ]; then
+	echo "Error: bitbake command not found."
+	echo "Did you forget to source the build environment script?"
+	exit 1
+fi
+
+packages=(`bitbake -s | awk '{ print \$1 }'`)
+versions=(`bitbake -s | awk '{ print \$2 }'`)
+
+echo "Package Num: ${#packages[*]} Version Num: ${#versions[*]}" >> "$REPORT_LOG"
+len=${#packages[*]}
+
+for (( i=0; i < "$len"; i++ )); do
+	pkg=${packages[$i]}
+
+	if [[ "$pkg" == "Loading" || "$pkg" == "Loaded" ||
+          "$pkg" == "Parsing" || "$pkg" == "Package" ||
+          "$pkg" == "NOTE:"   || "$pkg" == "WARNING:" ||
+          "$pkg" == "done."   || "$pkg" == "============" ||
+          "$pkg" == "ERROR:"  || "$pkg" == "Traceback" ||
+          "$pkg" == "File"    || "$pkg" == "IndexError:" ]]
+	then
+		# Skip initial bitbake output
+		continue
+	fi
+
+	SUMMARY=`bitbake -e $pkg | grep -e "^SUMMARY *=" | awk -F '=' '{ print \$2 }' | awk -F '"' '{ print \$2 }'`
+	ver=${versions[$i]#*:} # remove ':' in the version
+	echo "Handling package $pkg ($i out of $len) ..."
+	echo "HANDLING SUMMARY of package $pkg ... $SUMMARY <---NOT---> $pkg version $ver" >> "$REPORT_LOG"
+
+	if [[ "$SUMMARY" =~ "$pkg"" version ""$ver" ]]; then
+		# find which summary is missing and report
+		maintainer=`cat ../meta/conf/distro/include/distro_tracking_fields.inc | grep -e "^RECIPE_MAINTAINER_pn-"$pkg" *=" | cut -d= -f2`
+		echo "$pkg"" = ""$maintainer" >> "$REPORT_MISSING_SUMMARY"
+	fi
+done
+echo "DONE!" >> "$REPORT_LOG"