summaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfs_rpm.bbclass
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2011-12-22 14:46:32 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-03 12:14:26 +0000
commit38c2f66ea79f3ee3fed1757160340548e7687181 (patch)
tree757ad1a88ce2394db734acb20e6bd63cd5cb3d24 /meta/classes/rootfs_rpm.bbclass
parent8a77467fe87de0e8a51e624aade2c994ee322836 (diff)
downloadpoky-38c2f66ea79f3ee3fed1757160340548e7687181.tar.gz
classes/image: implement generic locale package installation
Let each package-specific rootfs implementation provide basic functions to query the existence of a package and install a list of packages and then have a generic install function so this logic is in one place. Note: unlike previous versions of this code in OE-Core this uses the IMAGE_LINGUAS variable and not IMAGE_LOCALES - note that IMAGE_LINGUAS was what was used in OE-Classic and it is already used in OE-Core in order to install locale-base-*. This will mean that if IMAGE_LINGUAS is left at the default you will now get more packages installed. If you don't want these language support packages then you should set IMAGE_LINGUAS explicitly. This restores locale installation to the same state as OE-Classic, only we now support all the packaging backends. (From OE-Core rev: c0fc36f8629a6abb9a7b542df8a2857526547a31) 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.bbclass35
1 files changed, 11 insertions, 24 deletions
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 966b074181..30f3783e3c 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -21,12 +21,7 @@ do_rootfs[depends] += "opkg-native:do_populate_sysroot"
21do_rootfs[recrdeptask] += "do_package_write_rpm" 21do_rootfs[recrdeptask] += "do_package_write_rpm"
22 22
23RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf; " 23RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf; "
24RPM_POSTPROCESS_COMMANDS = "" 24RPM_POSTPROCESS_COMMANDS = "rootfs_install_all_locales; "
25
26# To test the install_all_locales.. enable the following...
27#RPM_POSTPROCESS_COMMANDS = "install_all_locales; "
28#
29#IMAGE_LOCALES="en-gb"
30 25
31# 26#
32# Allow distributions to alter when [postponed] package install scripts are run 27# Allow distributions to alter when [postponed] package install scripts are run
@@ -198,24 +193,16 @@ list_package_recommends() {
198 ${RPM_QUERY_CMD} -q --suggests $1 193 ${RPM_QUERY_CMD} -q --suggests $1
199} 194}
200 195
201install_all_locales() { 196rootfs_check_package_exists() {
202 PACKAGES_TO_INSTALL="" 197 resolve_package_rpm ${RPMCONF_TARGET_BASE}-base_archs.conf $1
203 198}
204 # Generate list of installed packages... 199
205 INSTALLED_PACKAGES=`list_installed_packages | egrep -v -- "(-locale-|-dev$|-doc$|^kernel|^glibc|^ttf|^task|^perl|^python)"` 200rootfs_install_packages() {
206 201 for pkg in $@; do
207 # This would likely be faster if we did it in one transaction 202 ${RPM} --root ${IMAGE_ROOTFS} -D "_dbpath ${rpmlibdir}" \
208 # but this should be good enough for the few users of this function... 203 -D "__dbi_txn create nofsync private" \
209 for pkg in $INSTALLED_PACKAGES; do 204 --noscripts --notriggers --noparentdirs --nolinktos \
210 for lang in ${IMAGE_LOCALES}; do 205 -Uhv $pkg || true
211 pkg_name=$(resolve_package_rpm $pkg-locale-$lang ${RPMCONF_TARGET_BASE}.conf)
212 if [ -n "$pkg_name" ]; then
213 ${RPM} --root ${IMAGE_ROOTFS} -D "_dbpath ${rpmlibdir}" \
214 -D "__dbi_txn create nofsync private" \
215 --noscripts --notriggers --noparentdirs --nolinktos \
216 -Uhv $pkg_name || true
217 fi
218 done
219 done 206 done
220} 207}
221 208