aboutsummaryrefslogtreecommitdiffstats
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
committerSaul Wold <sgw@linux.intel.com>2012-01-02 20:26:25 -0800
commitc0fc36f8629a6abb9a7b542df8a2857526547a31 (patch)
treee93356851c58b384242fbc3d766d7ca967d6ba16 /meta/classes/rootfs_rpm.bbclass
parente0ebe12541a6628b7629a9be5918d0e7ea92aa33 (diff)
downloadopenembedded-core-contrib-c0fc36f8629a6abb9a7b542df8a2857526547a31.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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
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"
do_rootfs[recrdeptask] += "do_package_write_rpm"
RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf; "
-RPM_POSTPROCESS_COMMANDS = ""
-
-# To test the install_all_locales.. enable the following...
-#RPM_POSTPROCESS_COMMANDS = "install_all_locales; "
-#
-#IMAGE_LOCALES="en-gb"
+RPM_POSTPROCESS_COMMANDS = "rootfs_install_all_locales; "
#
# Allow distributions to alter when [postponed] package install scripts are run
@@ -198,24 +193,16 @@ list_package_recommends() {
${RPM_QUERY_CMD} -q --suggests $1
}
-install_all_locales() {
- PACKAGES_TO_INSTALL=""
-
- # Generate list of installed packages...
- INSTALLED_PACKAGES=`list_installed_packages | egrep -v -- "(-locale-|-dev$|-doc$|^kernel|^glibc|^ttf|^task|^perl|^python)"`
-
- # This would likely be faster if we did it in one transaction
- # but this should be good enough for the few users of this function...
- for pkg in $INSTALLED_PACKAGES; do
- for lang in ${IMAGE_LOCALES}; do
- pkg_name=$(resolve_package_rpm $pkg-locale-$lang ${RPMCONF_TARGET_BASE}.conf)
- if [ -n "$pkg_name" ]; then
- ${RPM} --root ${IMAGE_ROOTFS} -D "_dbpath ${rpmlibdir}" \
- -D "__dbi_txn create nofsync private" \
- --noscripts --notriggers --noparentdirs --nolinktos \
- -Uhv $pkg_name || true
- fi
- done
+rootfs_check_package_exists() {
+ resolve_package_rpm ${RPMCONF_TARGET_BASE}-base_archs.conf $1
+}
+
+rootfs_install_packages() {
+ for pkg in $@; do
+ ${RPM} --root ${IMAGE_ROOTFS} -D "_dbpath ${rpmlibdir}" \
+ -D "__dbi_txn create nofsync private" \
+ --noscripts --notriggers --noparentdirs --nolinktos \
+ -Uhv $pkg || true
done
}