diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2011-12-22 14:46:32 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-01-03 12:14:26 +0000 |
commit | 38c2f66ea79f3ee3fed1757160340548e7687181 (patch) | |
tree | 757ad1a88ce2394db734acb20e6bd63cd5cb3d24 /meta/classes/image.bbclass | |
parent | 8a77467fe87de0e8a51e624aade2c994ee322836 (diff) | |
download | poky-38c2f66ea79f3ee3fed1757160340548e7687181.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.
(From OE-Core rev: c0fc36f8629a6abb9a7b542df8a2857526547a31)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r-- | meta/classes/image.bbclass | 37 |
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() { | |||
255 | echo $@ | python ${MULTILIB_CHECK_FILE} | 255 | echo $@ | python ${MULTILIB_CHECK_FILE} |
256 | } | 256 | } |
257 | 257 | ||
258 | get_split_linguas() { | ||
259 | for translation in ${IMAGE_LINGUAS}; do | ||
260 | translation_split=$(echo ${translation} | awk -F '-' '{print $1}') | ||
261 | echo ${translation} | ||
262 | echo ${translation_split} | ||
263 | done | sort | uniq | ||
264 | } | ||
265 | |||
266 | rootfs_install_all_locales() { | ||
267 | # Generate list of installed packages for which additional locale packages might be available | ||
268 | INSTALLED_PACKAGES=`list_installed_packages | egrep -v -- "(-locale-|^locale-base-|-dev$|-doc$|^kernel|^glibc|^ttf|^task|^perl|^python)"` | ||
269 | |||
270 | # Generate a list of locale packages that exist | ||
271 | SPLIT_LINGUAS=`get_split_linguas` | ||
272 | PACKAGES_TO_INSTALL="" | ||
273 | for lang in $SPLIT_LINGUAS; do | ||
274 | for pkg in $INSTALLED_PACKAGES; do | ||
275 | existing_pkg=`rootfs_check_package_exists $pkg-locale-$lang` | ||
276 | if [ "$existing_pkg" != "" ]; then | ||
277 | PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL $existing_pkg" | ||
278 | fi | ||
279 | done | ||
280 | done | ||
281 | |||
282 | # Install the packages, if any | ||
283 | if [ "$PACKAGES_TO_INSTALL" != "" ]; then | ||
284 | rootfs_install_packages $PACKAGES_TO_INSTALL | ||
285 | fi | ||
286 | |||
287 | # Workaround for broken shell function dependencies | ||
288 | if false ; then | ||
289 | get_split_linguas | ||
290 | list_installed_packages | ||
291 | rootfs_check_package_exists | ||
292 | fi | ||
293 | } | ||
294 | |||
258 | # set '*' as the root password so the images | 295 | # set '*' as the root password so the images |
259 | # can decide if they want it or not | 296 | # can decide if they want it or not |
260 | zap_root_password () { | 297 | zap_root_password () { |