summaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfs_rpm.bbclass
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-07-23 07:59:11 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-29 10:16:15 +0100
commit20ad566d609bccdadf871dab1bc31a0e243f8710 (patch)
treefaea9496677371ab81ea2704183c01ce54d088df /meta/classes/rootfs_rpm.bbclass
parent98b0f956e7d16c2791cc00dbb75187b886e4cbcd (diff)
downloadpoky-20ad566d609bccdadf871dab1bc31a0e243f8710.tar.gz
buildhistory: improve performance of image info collection
Reduce the number of calls to the packaging tool, especially in the case of rpm, using helper utilities to gather the required information more efficiently where possible. (From OE-Core rev: d0b8a98c5b46c305afd389fc862b3bf0c6f1eaab) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/rootfs_rpm.bbclass')
-rw-r--r--meta/classes/rootfs_rpm.bbclass33
1 files changed, 4 insertions, 29 deletions
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 1cc4a84495..c9258dfe39 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -143,40 +143,15 @@ RPM_QUERY_CMD = '${RPM} --root $INSTALL_ROOTFS_RPM -D "_dbpath ${rpmlibdir}" \
143list_installed_packages() { 143list_installed_packages() {
144 if [ "$1" = "arch" ] ; then 144 if [ "$1" = "arch" ] ; then
145 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" 145 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]"
146 elif [ "$1" = "file" ] ; then
147 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{PACKAGEORIGIN}\n]"
146 else 148 else
147 ${RPM_QUERY_CMD} -qa --qf "[%{NAME}\n]" 149 ${RPM_QUERY_CMD} -qa --qf "[%{NAME}\n]"
148 fi 150 fi
149} 151}
150 152
151get_package_filename() { 153rootfs_list_installed_depends() {
152 resolve_package_rpm ${RPMCONF_TARGET_BASE}-base_archs.conf $1 154 rpmresolve -d $INSTALL_ROOTFS_RPM/${rpmlibdir}
153}
154
155list_package_depends() {
156 pkglist=`list_installed_packages`
157
158 # REQUIRE* lists "soft" requirements (which we know as recommends and RPM refers to
159 # as "suggests") so filter these out with the help of awk
160 for req in `${RPM_QUERY_CMD} -q --qf "[%{REQUIRENAME} %{REQUIREFLAGS}\n]" $1 | awk '{ if( and($2, 0x80000) == 0) print $1 }'`; do
161 if echo "$req" | grep -q "^rpmlib" ; then continue ; fi
162
163 realpkg=""
164 for dep in $pkglist; do
165 if [ "$dep" = "$req" ] ; then
166 realpkg="1"
167 echo $req
168 break
169 fi
170 done
171
172 if [ "$realdep" = "" ] ; then
173 ${RPM_QUERY_CMD} -q --whatprovides $req --qf "%{NAME}\n"
174 fi
175 done
176}
177
178list_package_recommends() {
179 ${RPM_QUERY_CMD} -q --suggests $1
180} 155}
181 156
182rootfs_install_packages() { 157rootfs_install_packages() {