summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2010-09-02 13:28:37 -0500
committerRichard Purdie <rpurdie@linux.intel.com>2010-09-03 09:45:29 +0100
commitd6c45f0f1184e94a45381af9813f831aaa9052ef (patch)
tree5177c7e361c519130c3e8d155805f123ab12a1e4 /meta
parent2f68de1e88fb196c301039ad994782b1a0c6ac94 (diff)
downloadpoky-d6c45f0f1184e94a45381af9813f831aaa9052ef.tar.gz
rootfs_rpm: Support install_all_locales
Support installing all locales similarly to how it is done within the ipk support. This has had basic testing, but it's not a normally used function so there could still be some flaws. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/rootfs_rpm.bbclass63
1 files changed, 33 insertions, 30 deletions
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index ace9677f06..00da8e514e 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -14,9 +14,14 @@ do_rootfs[recrdeptask] += "do_package_write_rpm"
14 14
15AWKPOSTINSTSCRIPT = "${POKYBASE}/scripts/rootfs_rpm-extract-postinst.awk" 15AWKPOSTINSTSCRIPT = "${POKYBASE}/scripts/rootfs_rpm-extract-postinst.awk"
16 16
17RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf" 17RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf; "
18RPM_POSTPROCESS_COMMANDS = "" 18RPM_POSTPROCESS_COMMANDS = ""
19 19
20# To test the install_all_locales.. enable the following...
21#RPM_POSTPROCESS_COMMANDS = "install_all_locales; "
22#
23#IMAGE_LOCALES="en-gb"
24
20rpmlibdir = "/var/lib/rpm" 25rpmlibdir = "/var/lib/rpm"
21opkglibdir = "${localstatedir}/lib/opkg" 26opkglibdir = "${localstatedir}/lib/opkg"
22 27
@@ -42,7 +47,7 @@ fakeroot rootfs_rpm_do_rootfs () {
42 for pkg in ${LINGUAS_INSTALL}; do 47 for pkg in ${LINGUAS_INSTALL}; do
43 echo "Processing $pkg..." 48 echo "Processing $pkg..."
44 pkg_name=$(resolve_package $pkg) 49 pkg_name=$(resolve_package $pkg)
45 if [ -z '$pkg_name' ]; then 50 if [ -z "$pkg_name" ]; then
46 echo "Unable to find package $pkg!" 51 echo "Unable to find package $pkg!"
47 exit 1 52 exit 1
48 fi 53 fi
@@ -55,7 +60,7 @@ fakeroot rootfs_rpm_do_rootfs () {
55 for pkg in ${PACKAGE_INSTALL} ; do 60 for pkg in ${PACKAGE_INSTALL} ; do
56 echo "Processing $pkg..." 61 echo "Processing $pkg..."
57 pkg_name=$(resolve_package $pkg) 62 pkg_name=$(resolve_package $pkg)
58 if [ -z '$pkg_name' ]; then 63 if [ -z "$pkg_name" ]; then
59 echo "Unable to find package $pkg!" 64 echo "Unable to find package $pkg!"
60 exit 1 65 exit 1
61 fi 66 fi
@@ -75,7 +80,7 @@ fakeroot rootfs_rpm_do_rootfs () {
75 for pkg in ${PACKAGE_INSTALL_ATTEMPTONLY} ; do 80 for pkg in ${PACKAGE_INSTALL_ATTEMPTONLY} ; do
76 echo "Processing $pkg..." 81 echo "Processing $pkg..."
77 pkg_name=$(resolve_package $pkg) 82 pkg_name=$(resolve_package $pkg)
78 if [ -z '$pkg_name' ]; then 83 if [ -z "$pkg_name" ]; then
79 echo "Unable to find package $pkg!" 84 echo "Unable to find package $pkg!"
80 exit 1 85 exit 1
81 fi 86 fi
@@ -109,7 +114,7 @@ fakeroot rootfs_rpm_do_rootfs () {
109 # Ohh there was a new one, we'll need to loop again... 114 # Ohh there was a new one, we'll need to loop again...
110 loop=1 115 loop=1
111 echo "Processing $pkg..." 116 echo "Processing $pkg..."
112 pkg_name=$(resolve_package $pkg || true) 117 pkg_name=$(resolve_package $pkg)
113 if [ -z "$pkg_name" ]; then 118 if [ -z "$pkg_name" ]; then
114 echo "Unable to find package $pkg." >> "${WORKDIR}/temp/log.do_rootfs_recommend.${PID}" 119 echo "Unable to find package $pkg." >> "${WORKDIR}/temp/log.do_rootfs_recommend.${PID}"
115 continue 120 continue
@@ -223,41 +228,39 @@ remove_packaging_data_files() {
223# Resolve package names to filepaths 228# Resolve package names to filepaths
224resolve_package() { 229resolve_package() {
225 pkg="$1" 230 pkg="$1"
231 pkg_name=""
226 for solve in `cat ${DEPLOY_DIR_RPM}/solvedb.conf`; do 232 for solve in `cat ${DEPLOY_DIR_RPM}/solvedb.conf`; do
227 pkg_name=$(${RPM} -D "_dbpath $solve" -D "_dbi_tags_3 Packages:Name:Basenames:Providename:Nvra" -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync" -q --yaml $pkg | grep -i 'Packageorigin' | cut -d : -f 2) 233 pkg_name=$(${RPM} -D "_dbpath $solve" -D "_dbi_tags_3 Packages:Name:Basenames:Providename:Nvra" -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync" -q --yaml $pkg | grep -i 'Packageorigin' | cut -d : -f 2)
228 if [ -n "$pkg_name" ]; then 234 if [ -n "$pkg_name" ]; then
229 break; 235 break;
230 fi 236 fi
231 done 237 done
232 if [ -z "$pkg_name" ]; then
233 return 1
234 fi
235 echo $pkg_name 238 echo $pkg_name
236 return 0
237} 239}
238 240
239install_all_locales() { 241install_all_locales() {
240 echo "install_all_locales: not yet implemented!" 242 PACKAGES_TO_INSTALL=""
241 exit 1 243
242 244 # Generate list of installed packages...
243 PACKAGES_TO_INSTALL="" 245 INSTALLED_PACKAGES=$( \
244 246 ${RPM} --root ${IMAGE_ROOTFS} -D "_dbpath ${rpmlibdir}" \
245 INSTALLED_PACKAGES=`grep ^Package: ${IMAGE_ROOTFS}${opkglibdir}/status |sed "s/^Package: //"|egrep -v -- "(-locale-|-dev$|-doc$|^kernel|^glibc|^ttf|^task|^perl|^python)"` 247 -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync private" \
246 248 -qa --qf "[%{NAME}\n]" | egrep -v -- "(-locale-|-dev$|-doc$|^kernel|^glibc|^ttf|^task|^perl|^python)" \
247 for pkg in $INSTALLED_PACKAGES 249 )
248 do 250
249 for lang in ${IMAGE_LOCALES} 251 # This would likely be faster if we did it in one transaction
250 do 252 # but this should be good enough for the few users of this function...
251 if [ `opkg-cl ${IPKG_ARGS} info $pkg-locale-$lang | wc -l` -gt 2 ] 253 for pkg in $INSTALLED_PACKAGES; do
252 then 254 for lang in ${IMAGE_LOCALES}; do
253 PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL $pkg-locale-$lang" 255 pkg_name=$(resolve_package $pkg-locale-$lang)
254 fi 256 if [ -n "$pkg_name" ]; then
255 done 257 ${RPM} --root ${IMAGE_ROOTFS} -D "_dbpath ${rpmlibdir}" \
256 done 258 --noscripts --notriggers --noparentdirs --nolinktos \
257 if [ "$PACKAGES_TO_INSTALL" != "" ] 259 -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync private" \
258 then 260 -Uhv $pkg_name || true
259 opkg-cl ${IPKG_ARGS} install $PACKAGES_TO_INSTALL 261 fi
260 fi 262 done
263 done
261} 264}
262 265
263python () { 266python () {