diff options
Diffstat (limited to 'meta/classes/rootfs_rpm.bbclass')
-rw-r--r-- | meta/classes/rootfs_rpm.bbclass | 47 |
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() { | |||
143 | RPM_QUERY_CMD = '${RPM} --root $INSTALL_ROOTFS_RPM -D "_dbpath ${rpmlibdir}"' | 151 | RPM_QUERY_CMD = '${RPM} --root $INSTALL_ROOTFS_RPM -D "_dbpath ${rpmlibdir}"' |
144 | 152 | ||
145 | list_installed_packages() { | 153 | list_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 | } |