diff options
author | Khem Raj <raj.khem@gmail.com> | 2011-07-14 14:54:38 +0000 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2011-07-14 14:24:24 +0200 |
commit | f265206496b333ee9f9f190a4b0ca610be0bd855 (patch) | |
tree | ff0c14a00add6a6f2516206c91ea9f4064fd73aa /meta-oe/classes | |
parent | fd183cfb3a092300f529634c39933c56558fb290 (diff) | |
download | meta-openembedded-f265206496b333ee9f9f190a4b0ca610be0bd855.tar.gz |
classes/testlab: Enhance to dump license information
It will now additionally create a new file which will
contain list of licenses of installed packages in a given
image.
The fix to get the package name is there because the packages
which contains epoch PE in the version string were not
being constructed correctly since opkg-cl would dump
'epoch:version' for Version string but the real ipk
did not have 'epoch' in its name. e.g.
for armv5te/libopkg0_0.1.8+svnr609-r2_armv5te.ipk
Package: libopkg0
Version: 1:0.1.8+svnr609-r2
as you can see version contained in ipk is not
containing the 'epoch'
so we have to eliminate 'epoch' from version we get from
opkg-cl to for the installed ipk name correctly.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/classes')
-rw-r--r-- | meta-oe/classes/testlab.bbclass | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/meta-oe/classes/testlab.bbclass b/meta-oe/classes/testlab.bbclass index cd59782a6..fd37242b9 100644 --- a/meta-oe/classes/testlab.bbclass +++ b/meta-oe/classes/testlab.bbclass | |||
@@ -36,7 +36,10 @@ if [ -e ${IMAGE_ROOTFS}/etc/opkg ] && [ "${ONLINE_PACKAGE_MANAGEMENT}" = "full" | |||
36 | echo -e "digraph depends {\n node [shape=plaintext]" > ${TESTLAB_DIR}/depends.dot | 36 | echo -e "digraph depends {\n node [shape=plaintext]" > ${TESTLAB_DIR}/depends.dot |
37 | 37 | ||
38 | for pkg in $(opkg-cl ${IPKG_ARGS} list_installed | awk '{print $1}') ; do | 38 | for pkg in $(opkg-cl ${IPKG_ARGS} list_installed | awk '{print $1}') ; do |
39 | opkg-cl ${IPKG_ARGS} info $pkg | grep -B 7 -A 7 "^Status.* \(\(installed\)\|\(unpacked\)\)" | awk '/^Package/ {printf $2"_"} /^Version/ {printf $2"_"} /^Archi/ {print $2".ipk"}' >> ${TESTLAB_DIR}/installed-packages.txt | 39 | name=`opkg-cl ${IPKG_ARGS} info $pkg | grep -B 7 -A 7 "^Status.* \(\(installed\)\|\(unpacked\)\)" | awk '/^Package/ {printf $2"_"}'` |
40 | name=$name`opkg-cl ${IPKG_ARGS} info $pkg | grep -B 7 -A 7 "^Status.* \(\(installed\)\|\(unpacked\)\)" | awk -F: '/^Version/ {printf $NF"_"}' | sed 's/^\s*//g'` | ||
41 | name=$name`opkg-cl ${IPKG_ARGS} info $pkg | grep -B 7 -A 7 "^Status.* \(\(installed\)\|\(unpacked\)\)" | awk '/^Archi/ {print $2".ipk"}'` | ||
42 | echo $name >>${TESTLAB_DIR}/installed-packages.txt | ||
40 | 43 | ||
41 | for depends in $(opkg-cl ${IPKG_ARGS} info $pkg | grep ^Depends) ; do | 44 | for depends in $(opkg-cl ${IPKG_ARGS} info $pkg | grep ^Depends) ; do |
42 | echo "$pkg OPP $depends;" | grep -v "(" | grep -v ")" | grep -v "$pkg OPP Depends" | sed -e 's:,::g' -e 's:-:_:g' -e 's:\.:_:g' -e 's:+::g' |sed 's:OPP:->:g' >> ${TESTLAB_DIR}/depends.dot | 45 | echo "$pkg OPP $depends;" | grep -v "(" | grep -v ")" | grep -v "$pkg OPP Depends" | sed -e 's:,::g' -e 's:-:_:g' -e 's:\.:_:g' -e 's:+::g' |sed 's:OPP:->:g' >> ${TESTLAB_DIR}/depends.dot |
@@ -65,6 +68,9 @@ if [ -e ${IMAGE_ROOTFS}/etc/opkg ] && [ "${ONLINE_PACKAGE_MANAGEMENT}" = "full" | |||
65 | du -k $(find ${DEPLOY_DIR_IPK} -name "$file") | head -n1 | 68 | du -k $(find ${DEPLOY_DIR_IPK} -name "$file") | head -n1 |
66 | done | grep "\.ipk" | sed -e s:${DEPLOY_DIR_IPK}::g | sort -n -r | awk '{print $1 "\tKiB " $2}' > ${TESTLAB_DIR}/installed-package-sizes.txt | 69 | done | grep "\.ipk" | sed -e s:${DEPLOY_DIR_IPK}::g | sort -n -r | awk '{print $1 "\tKiB " $2}' > ${TESTLAB_DIR}/installed-package-sizes.txt |
67 | 70 | ||
71 | for file in $(cat ${TESTLAB_DIR}/installed-packages.txt) ; do | ||
72 | echo "`find ${DEPLOY_DIR_IPK} -name "$file" | xargs opkg-list-fields | grep ^License | sed -e 's/^.*:[ \t]*//g'`" '=' $file | ||
73 | done | awk -F= '{printf("%50s:%s\n", $1, $2)}' > ${TESTLAB_DIR}/installed-package-licenses.txt | ||
68 | # Log results to a git controlled directory structure than can be pushed to a remote location | 74 | # Log results to a git controlled directory structure than can be pushed to a remote location |
69 | if [ "${TESTLABLOG}" = "remote" ] && [ -n "${TESTLABREMOTEDIR}" ] ; then | 75 | if [ "${TESTLABLOG}" = "remote" ] && [ -n "${TESTLABREMOTEDIR}" ] ; then |
70 | TESTLABLOGDIR="${MACHINE_ARCH}/${TCLIBC}/${IMAGE_BASENAME}" | 76 | TESTLABLOGDIR="${MACHINE_ARCH}/${TCLIBC}/${IMAGE_BASENAME}" |