diff options
author | Lianhao Lu <lianhao.lu@intel.com> | 2011-08-16 16:26:49 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-08-17 15:14:56 +0100 |
commit | 57bd62ad5c623216b50393841e1e75c867894765 (patch) | |
tree | ed020390a1f8c9839b61982d0c0453f60233df81 /meta/classes | |
parent | f759bde4f7c3a0f82a0a910df2ead755ae989ac2 (diff) | |
download | poky-57bd62ad5c623216b50393841e1e75c867894765.tar.gz |
package(_ipk).bbclass: opkg using ALL_MULTILIB_PACKAGE_ARCHS
[YOCTO #1345]
The new variable ALL_MULTILIB_PACKAGE_ARCHS contains all the values of
PACKAGE_ARCHS for each multilib variants. The opkg backend now uses this
new value insteald of the PACKAGE_ARCHS to update the opkg indexes and
to generate the opkg configuration files. This allows the normal
packages and multilib packages may be installed into the same rootfs.
(From OE-Core rev: b774bf44ef004276da12a83ebd69715c00b596ac)
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/package.bbclass | 13 | ||||
-rw-r--r-- | meta/classes/package_ipk.bbclass | 30 | ||||
-rw-r--r-- | meta/classes/utils.bbclass | 24 |
3 files changed, 29 insertions, 38 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index 100f465d9c..96675dedb6 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
@@ -46,6 +46,8 @@ PKGDEST = "${WORKDIR}/packages-split" | |||
46 | 46 | ||
47 | LOCALE_SECTION ?= '' | 47 | LOCALE_SECTION ?= '' |
48 | 48 | ||
49 | ALL_MULTILIB_PACKAGE_ARCHS = "${@all_multilib_tune_values(d, 'PACKAGE_ARCHS')}" | ||
50 | |||
49 | # rpm is used for the per-file dependency identification | 51 | # rpm is used for the per-file dependency identification |
50 | PACKAGE_DEPENDS += "rpm-native" | 52 | PACKAGE_DEPENDS += "rpm-native" |
51 | 53 | ||
@@ -184,17 +186,6 @@ python () { | |||
184 | bb.data.setVarFlag('do_package', 'deptask', " ".join(deps), d) | 186 | bb.data.setVarFlag('do_package', 'deptask', " ".join(deps), d) |
185 | else: | 187 | else: |
186 | d.setVar("PACKAGERDEPTASK", "") | 188 | d.setVar("PACKAGERDEPTASK", "") |
187 | |||
188 | multilib_archs = [] | ||
189 | multilibs= d.getVar('MULTILIBS', True) or "" | ||
190 | if multilibs: | ||
191 | for ext in multilibs.split(): | ||
192 | eext = ext.split(':') | ||
193 | if len(eext) > 1: | ||
194 | if eext[0] == 'multilib': | ||
195 | multilib_archs.append('ml' + eext[1]) | ||
196 | |||
197 | d.setVar("MULTILIB_ARCHS", ' '.join(multilib_archs)) | ||
198 | } | 189 | } |
199 | 190 | ||
200 | def splitfile(file, debugfile, debugsrcdir, d): | 191 | def splitfile(file, debugfile, debugsrcdir, d): |
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass index 8ecf5111a8..e83aff8fe9 100644 --- a/meta/classes/package_ipk.bbclass +++ b/meta/classes/package_ipk.bbclass | |||
@@ -64,14 +64,13 @@ python package_ipk_install () { | |||
64 | package_tryout_install_multilib_ipk() { | 64 | package_tryout_install_multilib_ipk() { |
65 | #try install multilib | 65 | #try install multilib |
66 | multilib_tryout_dirs="" | 66 | multilib_tryout_dirs="" |
67 | for arch in ${MULTILIB_ARCHS}; do | 67 | for item in ${MULTILIB_VARIANTS}; do |
68 | local target_rootfs="${MULTILIB_TEMP_ROOTFS}/${arch}" | 68 | local target_rootfs="${MULTILIB_TEMP_ROOTFS}/${item}" |
69 | local ipkg_args="-f ${INSTALL_CONF_IPK} -o ${target_rootfs} --force_overwrite" | 69 | local ipkg_args="-f ${INSTALL_CONF_IPK} -o ${target_rootfs} --force_overwrite" |
70 | local selected_pkg="" | 70 | local selected_pkg="" |
71 | #strip the "ml" from package_arch | 71 | local pkgname_prefix="${item}-" |
72 | local pkgarch_prefix="${arch:2}-" | 72 | for pkg in ${INSTALL_PACKAGES_MULTILIB_IPK}; do |
73 | for pkg in "${INSTALL_PACKAGES_MULTILIB_IPK}"; do | 73 | if [ ${pkg:0:${#pkgname_prefix}} == ${pkgname_prefix} ]; then |
74 | if [ ${pkg:0:${#pkgarch_prefix}} == ${pkgarch_prefix} ]; then | ||
75 | selected_pkg="${selected_pkg} ${pkg}" | 74 | selected_pkg="${selected_pkg} ${pkg}" |
76 | fi | 75 | fi |
77 | done | 76 | done |
@@ -163,7 +162,7 @@ ipk_log_check() { | |||
163 | package_update_index_ipk () { | 162 | package_update_index_ipk () { |
164 | set -x | 163 | set -x |
165 | 164 | ||
166 | ipkgarchs="${PACKAGE_ARCHS} ${SDK_PACKAGE_ARCHS}" | 165 | ipkgarchs="${ALL_MULTILIB_PACKAGE_ARCHS} ${SDK_PACKAGE_ARCHS}" |
167 | 166 | ||
168 | if [ ! -z "${DEPLOY_KEEP_PACKAGES}" ]; then | 167 | if [ ! -z "${DEPLOY_KEEP_PACKAGES}" ]; then |
169 | return | 168 | return |
@@ -203,19 +202,12 @@ package_generate_ipkg_conf () { | |||
203 | done | 202 | done |
204 | 203 | ||
205 | echo "src oe file:${DEPLOY_DIR_IPK}" >> ${IPKGCONF_TARGET} | 204 | echo "src oe file:${DEPLOY_DIR_IPK}" >> ${IPKGCONF_TARGET} |
206 | ipkgarchs="${PACKAGE_ARCHS}" | 205 | ipkgarchs="${ALL_MULTILIB_PACKAGE_ARCHS}" |
207 | for arch in $ipkgarchs; do | 206 | for arch in $ipkgarchs; do |
208 | if [ -e ${DEPLOY_DIR_IPK}/$arch/Packages ] ; then | 207 | if [ -e ${DEPLOY_DIR_IPK}/$arch/Packages ] ; then |
209 | echo "src oe-$arch file:${DEPLOY_DIR_IPK}/$arch" >> ${IPKGCONF_TARGET} | 208 | echo "src oe-$arch file:${DEPLOY_DIR_IPK}/$arch" >> ${IPKGCONF_TARGET} |
210 | fi | 209 | fi |
211 | done | 210 | done |
212 | |||
213 | multilib_archs="${MULTILIB_ARCHS}" | ||
214 | for arch in $multilib_archs; do | ||
215 | if [ -e ${DEPLOY_DIR_IPK}/$arch/Packages ] ; then | ||
216 | echo "src oe-$arch file:${DEPLOY_DIR_IPK}/$arch" >> ${IPKGCONF_TARGET} | ||
217 | fi | ||
218 | done | ||
219 | } | 211 | } |
220 | 212 | ||
221 | package_generate_archlist () { | 213 | package_generate_archlist () { |
@@ -226,18 +218,12 @@ package_generate_archlist () { | |||
226 | priority=$(expr $priority + 5) | 218 | priority=$(expr $priority + 5) |
227 | done | 219 | done |
228 | 220 | ||
229 | ipkgarchs="${PACKAGE_ARCHS}" | 221 | ipkgarchs="${ALL_MULTILIB_PACKAGE_ARCHS}" |
230 | priority=1 | 222 | priority=1 |
231 | for arch in $ipkgarchs; do | 223 | for arch in $ipkgarchs; do |
232 | echo "arch $arch $priority" >> ${IPKGCONF_TARGET} | 224 | echo "arch $arch $priority" >> ${IPKGCONF_TARGET} |
233 | priority=$(expr $priority + 5) | 225 | priority=$(expr $priority + 5) |
234 | done | 226 | done |
235 | |||
236 | multilib_archs="${MULTILIB_ARCHS}" | ||
237 | for arch in $multilib_archs; do | ||
238 | echo "arch $arch $priority" >> ${IPKGCONF_TARGET} | ||
239 | priority=$(expr $priority + 5) | ||
240 | done | ||
241 | } | 227 | } |
242 | 228 | ||
243 | python do_package_ipk () { | 229 | python do_package_ipk () { |
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass index c66c18449a..56abdd844c 100644 --- a/meta/classes/utils.bbclass +++ b/meta/classes/utils.bbclass | |||
@@ -352,12 +352,16 @@ def extend_variants(d, var, extend, delim=':'): | |||
352 | variants.append(eext[1]) | 352 | variants.append(eext[1]) |
353 | return " ".join(variants) | 353 | return " ".join(variants) |
354 | 354 | ||
355 | def all_multilib_tune_values(d, var, unique=True): | 355 | def all_multilib_tune_values(d, var, unique = True, need_split = True, delim = ' '): |
356 | """Return a string of all ${var} in all multilib tune configuration""" | 356 | """Return a string of all ${var} in all multilib tune configuration""" |
357 | values = [] | 357 | values = [] |
358 | value = d.getVar(var, True) or "" | 358 | value = d.getVar(var, True) or "" |
359 | if value != "": | 359 | if value != "": |
360 | values.append(value) | 360 | if need_split: |
361 | for item in value.split(delim): | ||
362 | values.append(item) | ||
363 | else: | ||
364 | values.append(value) | ||
361 | variants = d.getVar("MULTILIB_VARIANTS", True) or "" | 365 | variants = d.getVar("MULTILIB_VARIANTS", True) or "" |
362 | for item in variants.split(): | 366 | for item in variants.split(): |
363 | localdata = bb.data.createCopy(d) | 367 | localdata = bb.data.createCopy(d) |
@@ -366,7 +370,17 @@ def all_multilib_tune_values(d, var, unique=True): | |||
366 | bb.data.update_data(localdata) | 370 | bb.data.update_data(localdata) |
367 | value = localdata.getVar(var, True) or "" | 371 | value = localdata.getVar(var, True) or "" |
368 | if value != "": | 372 | if value != "": |
369 | values.append(value) | 373 | if need_split: |
374 | for item in value.split(delim): | ||
375 | values.append(item) | ||
376 | else: | ||
377 | values.append(value) | ||
370 | if unique: | 378 | if unique: |
371 | values = set(values) | 379 | #we do this to keep order as much as possible |
372 | return " ".join(values) | 380 | ret = [] |
381 | for value in values: | ||
382 | if not value in ret: | ||
383 | ret.append(value) | ||
384 | else: | ||
385 | ret = values | ||
386 | return " ".join(ret) | ||