summaryrefslogtreecommitdiff
path: root/meta/classes/image.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/image.bbclass
parente0ebe12541a6628b7629a9be5918d0e7ea92aa33 (diff)
downloadopenembedded-core-c0fc36f8629a6abb9a7b542df8a2857526547a31.tar.gz
openembedded-core-c0fc36f8629a6abb9a7b542df8a2857526547a31.tar.bz2
openembedded-core-c0fc36f8629a6abb9a7b542df8a2857526547a31.zip
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/image.bbclass')
-rw-r--r--meta/classes/image.bbclass37
1 files changed, 37 insertions, 0 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 865d430121..275b28f4ac 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -255,6 +255,43 @@ multilib_sanity_check() {
echo $@ | python ${MULTILIB_CHECK_FILE}
}
+get_split_linguas() {
+ for translation in ${IMAGE_LINGUAS}; do
+ translation_split=$(echo ${translation} | awk -F '-' '{print $1}')
+ echo ${translation}
+ echo ${translation_split}
+ done | sort | uniq
+}
+
+rootfs_install_all_locales() {
+ # Generate list of installed packages for which additional locale packages might be available
+ INSTALLED_PACKAGES=`list_installed_packages | egrep -v -- "(-locale-|^locale-base-|-dev$|-doc$|^kernel|^glibc|^ttf|^task|^perl|^python)"`
+
+ # Generate a list of locale packages that exist
+ SPLIT_LINGUAS=`get_split_linguas`
+ PACKAGES_TO_INSTALL=""
+ for lang in $SPLIT_LINGUAS; do
+ for pkg in $INSTALLED_PACKAGES; do
+ existing_pkg=`rootfs_check_package_exists $pkg-locale-$lang`
+ if [ "$existing_pkg" != "" ]; then
+ PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL $existing_pkg"
+ fi
+ done
+ done
+
+ # Install the packages, if any
+ if [ "$PACKAGES_TO_INSTALL" != "" ]; then
+ rootfs_install_packages $PACKAGES_TO_INSTALL
+ fi
+
+ # Workaround for broken shell function dependencies
+ if false ; then
+ get_split_linguas
+ list_installed_packages
+ rootfs_check_package_exists
+ fi
+}
+
# set '*' as the root password so the images
# can decide if they want it or not
zap_root_password () {