From 6cf6511c7510f7f1db1c836d90d38f433316d377 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Fri, 12 Jun 2009 17:58:19 +0200 Subject: 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 --- classes/image.bbclass | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'classes/image.bbclass') 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 -- cgit v1.2.3