summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2009-06-12 17:58:19 +0200
committerKoen Kooi <koen@openembedded.org>2009-06-12 17:58:19 +0200
commit6cf6511c7510f7f1db1c836d90d38f433316d377 (patch)
tree58d887fb33b38035420c69f141912e9b19e5e213
parent649b44a943f5a2cca45b346b903e6cdee7d5ed21 (diff)
image bbclass: add install_linguas method
* this method will install all linguas in $IMAGE_LINGUAS for all packages installed into the rootfs * currently opkg only, guarded with a check
-rw-r--r--classes/image.bbclass26
1 files changed, 25 insertions, 1 deletions
diff --git a/classes/image.bbclass b/classes/image.bbclass
index 89d27120c1..43eb3f3dc7 100644
--- a/classes/image.bbclass
+++ b/classes/image.bbclass
@@ -231,8 +231,32 @@ rootfs_update_timestamp () {
date "+%m%d%H%M%Y" >${IMAGE_ROOTFS}/etc/timestamp
}
+# Install locales into image for every entry in IMAGE_LINGUAS
+install_linguas() {
+if [ -e ${IMAGE_ROOTFS}/usr/bin/opkg-cl ] ; then
+ OPKG="opkg-cl ${IPKG_ARGS}"
+
+ ${OPKG} update
+ ${OPKG} list_installed | awk '{print $1}' |sort | uniq > /tmp/installed-packages
+
+ for i in $(cat /tmp/installed-packages) ; do
+ for translation in ${IMAGE_LINGUAS}; do
+ echo ${i}-locale-${translation}
+ done
+ done | sort | uniq > /tmp/wanted-locale-packages
+
+ ${OPKG} list | awk '{print $1}' |grep locale |sort | uniq > /tmp/available-locale-packages
+
+ cat /tmp/wanted-locale-packages /tmp/available-locale-packages | sort | uniq -d > /tmp/pending-locale-packages
+ cat /tmp/installed-packages /tmp/pending-locale-packages | grep locale | sort | uniq -u > /tmp/translation-list
+
+ cat /tmp/translation-list | xargs ${OPKG} -nodeps install
+ rm -f ${IMAGE_ROOTFS}${libdir}/opkg/lists/*
+fi
+}
+
# export the zap_root_password, create_etc_timestamp and remote_init_link
-EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link do_rootfs make_zimage_symlink_relative set_image_autologin rootfs_update_timestamp
+EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link do_rootfs make_zimage_symlink_relative set_image_autologin rootfs_update_timestamp install_linguas
addtask rootfs after do_compile before do_install
addtask deploy_to after do_rootfs