]> code.ossystems Code Review - openembedded-core.git/commitdiff
rootfs_ipk.bbclass: added install_all_locales function
authorMarcin Juszkiewicz <hrw@openedhand.com>
Thu, 5 Jun 2008 20:51:43 +0000 (20:51 +0000)
committerMarcin Juszkiewicz <hrw@openedhand.com>
Thu, 5 Jun 2008 20:51:43 +0000 (20:51 +0000)
This code checks which packages got installed in rootfs and install
locale packages for all languages (taken from IMAGE_LOCALES).

git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4588 311d38ba-8fff-0310-9ca6-ca027cbcb966

meta/classes/rootfs_ipk.bbclass

index 2f18a24a793ebaeacdafd078b85f88bcaf018168..466edfb059870472703b007d49834e04029af3f7 100644 (file)
@@ -87,3 +87,24 @@ rootfs_ipk_log_check() {
 remove_packaging_data_files() {
        rm -rf ${IMAGE_ROOTFS}/usr/lib/opkg/
 }
+
+install_all_locales() {
+
+    PACKAGES_TO_INSTALL=""
+
+    for pkg in `grep ^Package: ${IMAGE_ROOTFS}${libdir}/opkg/status |sed "s/^Package: //"|egrep -v -- "(-locale-|-dev$|-doc$|^kernel|^glibc|^ttf|^task|^perl|^python)"`
+    do
+       for lang in ${IMAGE_LOCALES}
+       do
+           if [ `opkg-cl ${IPKG_ARGS} info $pkg-locale-$lang | wc -l` -gt 0 ]
+           then
+                PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL $pkg-locale-$lang"
+           fi
+       done
+    done
+    if [ "$PACKAGES_TO_INSTALL" != "" ]
+    then
+       opkg-cl ${IPKG_ARGS} install $PACKAGES_TO_INSTALL
+    fi
+}
+