summaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfs_rpm.bbclass
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2012-11-30 16:11:37 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-17 17:24:51 +0000
commita6aa74817cce38799b447cd47ef6f77aee9fcc85 (patch)
treee02a6b60d8fb05386b67dd89848c48acec4709d7 /meta/classes/rootfs_rpm.bbclass
parentba08a8ccbf11542867b7dd0474599fccb0585b97 (diff)
downloadpoky-a6aa74817cce38799b447cd47ef6f77aee9fcc85.tar.gz
package_rpm: Update the way the multilib package names are translated
The variable MULTILIB_PACKAGE_ARCHS has been removed in favor of a repurposed MULTILIB_PREFIX_LIST. The format of this item is now <libid>:<arch>:<arch1>:...:<archN>. This ensures that we can correctly translate the libid to one of the supported archs in a tri-lib system. All of the users of MULTILIB_PREFIX_LIST and MULTILIB_PACKAGE_ARCHS have been modified accordingly. Also change the way attempted packages are installed, verify the package exists in the translate functions, then perform the install in one single operation. This results in a significantly faster install time. (From OE-Core rev: ffe6cf3a1c57defdbe8531bdeb588e199177bb6c) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@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.bbclass47
1 files changed, 23 insertions, 24 deletions
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index a507ad62e8..5000956d14 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -62,8 +62,16 @@ fakeroot rootfs_rpm_do_rootfs () {
62 62
63 # List must be prefered to least preferred order 63 # List must be prefered to least preferred order
64 INSTALL_PLATFORM_EXTRA_RPM="" 64 INSTALL_PLATFORM_EXTRA_RPM=""
65 for each_arch in ${MULTILIB_PACKAGE_ARCHS} ${PACKAGE_ARCHS}; do 65 for i in ${MULTILIB_PREFIX_LIST} ; do
66 INSTALL_PLATFORM_EXTRA_RPM="$each_arch $INSTALL_PLATFORM_EXTRA_RPM" 66 old_IFS="$IFS"
67 IFS=":"
68 set $i
69 IFS="$old_IFS"
70 shift #remove mlib
71 while [ -n "$1" ]; do
72 INSTALL_PLATFORM_EXTRA_RPM="$INSTALL_PLATFORM_EXTRA_RPM $1"
73 shift
74 done
67 done 75 done
68 export INSTALL_PLATFORM_RPM 76 export INSTALL_PLATFORM_RPM
69 77
@@ -143,21 +151,12 @@ rpm_setup_smart_target_config() {
143RPM_QUERY_CMD = '${RPM} --root $INSTALL_ROOTFS_RPM -D "_dbpath ${rpmlibdir}"' 151RPM_QUERY_CMD = '${RPM} --root $INSTALL_ROOTFS_RPM -D "_dbpath ${rpmlibdir}"'
144 152
145list_installed_packages() { 153list_installed_packages() {
146 GET_LIST=$(${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH} %{PACKAGEORIGIN} %{Platform}\n]") 154 if [ "$1" = "arch" ]; then
147 155 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" | translate_smart_to_oe arch | tee /tmp/arch_list
148 # Use awk to find the multilib prefix and compare it 156 elif [ "$1" = "file" ]; then
149 # with the platform RPM thinks it is part of 157 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH} %{PACKAGEORIGIN}\n]" | translate_smart_to_oe | tee /tmp/file_list
150 for prefix in `echo ${MULTILIB_PREFIX_LIST}`; do 158 else
151 GET_LIST=$(echo "$GET_LIST" | awk -v prefix="$prefix" '$0 ~ prefix {printf("%s-%s\n", prefix, $0); } $0 !~ prefix {print $0}') 159 ${RPM_QUERY_CMD} -qa --qf "[%{NAME} %{ARCH}\n]" | translate_smart_to_oe | tee /tmp/default_list
152 done
153
154 # print the info, need to different return counts
155 if [ "$1" = "arch" ] ; then
156 echo "$GET_LIST" | awk -v archs="${PACKAGE_ARCHS}" '{if(!index(archs, $2)) {gsub("_", "-", $2)} print $1, $2}'
157 elif [ "$1" = "file" ] ; then
158 echo "$GET_LIST" | awk '{print $1, $3}'
159 else
160 echo "$GET_LIST" | awk '{print $1}'
161 fi 160 fi
162} 161}
163 162
@@ -187,8 +186,11 @@ python () {
187 d.setVar('RPM_POSTPROCESS_COMMANDS', '') 186 d.setVar('RPM_POSTPROCESS_COMMANDS', '')
188 187
189 # The following code should be kept in sync w/ the populate_sdk_rpm version. 188 # The following code should be kept in sync w/ the populate_sdk_rpm version.
190 ml_package_archs = "" 189
191 ml_prefix_list = "" 190 # package_arch order is reversed. This ensures the -best- match is listed first!
191 package_archs = d.getVar("PACKAGE_ARCHS", True) or ""
192 package_archs = ":".join(package_archs.split()[::-1])
193 ml_prefix_list = "%s:%s" % ('default', package_archs)
192 multilibs = d.getVar('MULTILIBS', True) or "" 194 multilibs = d.getVar('MULTILIBS', True) or ""
193 for ext in multilibs.split(): 195 for ext in multilibs.split():
194 eext = ext.split(':') 196 eext = ext.split(':')
@@ -198,10 +200,7 @@ python () {
198 if default_tune: 200 if default_tune:
199 localdata.setVar("DEFAULTTUNE", default_tune) 201 localdata.setVar("DEFAULTTUNE", default_tune)
200 package_archs = localdata.getVar("PACKAGE_ARCHS", True) or "" 202 package_archs = localdata.getVar("PACKAGE_ARCHS", True) or ""
201 package_archs = " ".join([i in "all noarch any".split() and i or eext[1]+"_"+i for i in package_archs.split()]) 203 package_archs = ":".join([i in "all noarch any".split() and i or eext[1]+"_"+i for i in package_archs.split()][::-1])
202 ml_package_archs += " " + package_archs 204 ml_prefix_list += " %s:%s" % (eext[1], package_archs)
203 ml_prefix_list += " " + eext[1]
204 #bb.note("ML_PACKAGE_ARCHS %s %s %s" % (eext[1], localdata.getVar("PACKAGE_ARCHS", True) or "(none)", overrides))
205 d.setVar('MULTILIB_PACKAGE_ARCHS', ml_package_archs)
206 d.setVar('MULTILIB_PREFIX_LIST', ml_prefix_list) 205 d.setVar('MULTILIB_PREFIX_LIST', ml_prefix_list)
207} 206}