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/rootfs_ipk.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/rootfs_ipk.bbclass')
| -rw-r--r-- | meta/classes/rootfs_ipk.bbclass | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass index b5556fa254..48fb2fbd18 100644 --- a/meta/classes/rootfs_ipk.bbclass +++ b/meta/classes/rootfs_ipk.bbclass | |||
| @@ -16,7 +16,7 @@ IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS} --force-overwrite" | |||
| 16 | 16 | ||
| 17 | OPKG_PREPROCESS_COMMANDS = "package_update_index_ipk; package_generate_ipkg_conf" | 17 | OPKG_PREPROCESS_COMMANDS = "package_update_index_ipk; package_generate_ipkg_conf" |
| 18 | 18 | ||
| 19 | OPKG_POSTPROCESS_COMMANDS = "ipk_insert_feed_uris" | 19 | OPKG_POSTPROCESS_COMMANDS = "ipk_insert_feed_uris; rootfs_install_all_locales; " |
| 20 | 20 | ||
| 21 | opkglibdir = "${localstatedir}/lib/opkg" | 21 | opkglibdir = "${localstatedir}/lib/opkg" |
| 22 | 22 | ||
| @@ -148,26 +148,14 @@ list_package_recommends() { | |||
| 148 | opkg-cl ${IPKG_ARGS} info $1 | grep ^Recommends | sed -e 's/^Recommends: //' -e 's/,//g' -e 's:([=<>]* [0-9a-zA-Z.~\-]*)::g' | 148 | opkg-cl ${IPKG_ARGS} info $1 | grep ^Recommends | sed -e 's/^Recommends: //' -e 's/,//g' -e 's:([=<>]* [0-9a-zA-Z.~\-]*)::g' |
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | install_all_locales() { | 151 | rootfs_check_package_exists() { |
| 152 | 152 | if [ `opkg-cl ${IPKG_ARGS} info $1 | wc -l` -gt 2 ]; then | |
| 153 | PACKAGES_TO_INSTALL="" | 153 | echo $1 |
| 154 | 154 | fi | |
| 155 | INSTALLED_PACKAGES=`list_installed_packages | egrep -v -- "(-locale-|-dev$|-doc$|^kernel|^glibc|^ttf|^task|^perl|^python)"` | 155 | } |
| 156 | 156 | ||
| 157 | for pkg in $INSTALLED_PACKAGES | 157 | rootfs_install_packages() { |
| 158 | do | 158 | opkg-cl ${IPKG_ARGS} install $PACKAGES_TO_INSTALL |
| 159 | for lang in ${IMAGE_LOCALES} | ||
| 160 | do | ||
| 161 | if [ `opkg-cl ${IPKG_ARGS} info $pkg-locale-$lang | wc -l` -gt 2 ] | ||
| 162 | then | ||
| 163 | PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL $pkg-locale-$lang" | ||
| 164 | fi | ||
| 165 | done | ||
| 166 | done | ||
| 167 | if [ "$PACKAGES_TO_INSTALL" != "" ] | ||
| 168 | then | ||
| 169 | opkg-cl ${IPKG_ARGS} install $PACKAGES_TO_INSTALL | ||
| 170 | fi | ||
| 171 | } | 159 | } |
| 172 | 160 | ||
| 173 | ipk_insert_feed_uris () { | 161 | ipk_insert_feed_uris () { |
