summaryrefslogtreecommitdiff
path: root/meta/classes
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2011-12-09 17:34:42 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-12-10 00:15:36 +0000
commit58fbb430040c9cce9f2c5f1515a4453dd49032cc (patch)
tree5ccc2f20e615670a324ef1cd88f50070edf4f5c5 /meta/classes
parentdb692fd5706eab9bfd94c115591d1411cf8e196e (diff)
downloadopenembedded-core-58fbb430040c9cce9f2c5f1515a4453dd49032cc.tar.gz
openembedded-core-58fbb430040c9cce9f2c5f1515a4453dd49032cc.tar.bz2
openembedded-core-58fbb430040c9cce9f2c5f1515a4453dd49032cc.zip
classes/rootfs_deb: implement query functions for buildhistory
Implement the functions required for buildhistory to be able to query installed packages, get dependencies etc. for deb-based images. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/rootfs_deb.bbclass23
1 files changed, 23 insertions, 0 deletions
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index bab8e1e8c7..bef055c6f5 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -81,3 +81,26 @@ remove_packaging_data_files() {
rm -rf ${IMAGE_ROOTFS}${opkglibdir}
rm -rf ${IMAGE_ROOTFS}/usr/dpkg/
}
+
+DPKG_QUERY_COMMAND = "${STAGING_BINDIR_NATIVE}/dpkg --admindir=${IMAGE_ROOTFS}/var/lib/dpkg"
+
+list_installed_packages() {
+ ${DPKG_QUERY_COMMAND} -l | grep ^ii | awk '{ print $2 }'
+}
+
+get_package_filename() {
+ fullname=`find ${DEPLOY_DIR_DEB} -name "$1_*.deb" || true`
+ if [ "$fullname" = "" ] ; then
+ echo $name
+ else
+ echo $fullname
+ fi
+}
+
+list_package_depends() {
+ ${DPKG_QUERY_COMMAND} -s $1 | grep ^Depends | sed -e 's/^Depends: //' -e 's/,//g' -e 's:([=<>]* [0-9a-zA-Z.~\-]*)::g'
+}
+
+list_package_recommends() {
+ ${DPKG_QUERY_COMMAND} -s $1 | grep ^Recommends | sed -e 's/^Recommends: //' -e 's/,//g' -e 's:([=<>]* [0-9a-zA-Z.~\-]*)::g'
+}