summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_rpm.bbclass
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2011-08-01 11:56:37 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-02 14:32:10 +0100
commit0d5dfb29c359eb778182660e852a6aca273f8179 (patch)
treed521c70b2cc963515c603185dfe84acbac614ba6 /meta/classes/package_rpm.bbclass
parentbe2a2764d8ceb398d81714661e6f199c8b11946c (diff)
downloadpoky-0d5dfb29c359eb778182660e852a6aca273f8179.tar.gz
rootfs_rpm: Cleanup and minor bug fixes
in packages_rpm.bbclass: Cleanup the way package_update_index_rpm works. Break this out into two functions, one for common functionality and one for controlling target vs sdk package processing. Similar change to package_generate_rpm_conf. Usage of IMAGE_ROOTFS should actually be "target_rootfs", this fixes a problem with the SDK case. in rootfs_rpm.bbclass: Minor re-order of the values, and avoid multiple uses of IMAGE_ROOTFS in order to make the merge with the SDK behavior easier. (From OE-Core rev: 46559f36d8a39655060b45d3d235de44a2c4c09b) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r--meta/classes/package_rpm.bbclass128
1 files changed, 55 insertions, 73 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 950f665db5..0f16613ba7 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -25,31 +25,41 @@ package_update_index_rpm () {
25 return 25 return
26 fi 26 fi
27 27
28 base_package_archs="${PACKAGE_ARCHS}" 28 # Update target packages
29 ml_package_archs="${MULTILIB_PACKAGE_ARCHS}" 29 base_archs="${PACKAGE_ARCHS}"
30 ml_archs="${MULTILIB_PACKAGE_ARCHS}"
31 package_update_index_rpm_common "${RPMCONF_TARGET_BASE}" base_archs ml_archs
32
33 # Update SDK packages
34 base_archs=""
35 for arch in ${PACKAGE_ARCHS}; do
36 sdkarch=`echo $arch | sed -e 's/${HOST_ARCH}/${SDK_ARCH}/'`
37 extension="-nativesdk"
38 if [ "$sdkarch" = "all" -o "$sdkarch" = "any" -o "$sdkarch" = "noarch" ]; then
39 extension=""
40 fi
41 base_archs="$base_archs $sdkarch$extension"
42 done
43 package_update_index_rpm_common "${RPMCONF_HOST_BASE}" base_archs
44}
45
46package_update_index_rpm_common () {
47 rpmconf_base="$1"
48 shift
30 49
31 for archvar in base_package_archs ml_package_archs; do 50 for archvar in "$@"; do
32 eval archs=\${${archvar}} 51 eval archs=\${${archvar}}
33 packagedirs="" 52 packagedirs=""
34 packagedirs_sdk=""
35 for arch in $archs; do 53 for arch in $archs; do
36 sdkarch=`echo $arch | sed -e 's/${HOST_ARCH}/${SDK_ARCH}/'`
37 extension="-nativesdk"
38 if [ "$sdkarch" = "all" -o "$sdkarch" = "any" -o "$sdkarch" = "noarch" ]; then
39 extension=""
40 fi
41 packagedirs="${DEPLOY_DIR_RPM}/$arch $packagedirs" 54 packagedirs="${DEPLOY_DIR_RPM}/$arch $packagedirs"
42 packagedirs_sdk="${DEPLOY_DIR_RPM}/$sdkarch$extension $packagedirs_sdk"
43
44 rm -rf ${DEPLOY_DIR_RPM}/$arch/solvedb 55 rm -rf ${DEPLOY_DIR_RPM}/$arch/solvedb
45 rm -rf ${DEPLOY_DIR_RPM}/$sdkarch$extension/solvedb
46 done 56 done
47 57
48 cat /dev/null > ${RPMCONF_TARGET_BASE}-${archvar}.conf 58 cat /dev/null > ${rpmconf_base}-${archvar}.conf
49 for pkgdir in $packagedirs; do 59 for pkgdir in $packagedirs; do
50 if [ -e $pkgdir/ ]; then 60 if [ -e $pkgdir/ ]; then
51 echo "Generating solve db for $pkgdir..." 61 echo "Generating solve db for $pkgdir..."
52 echo $pkgdir/solvedb >> ${RPMCONF_TARGET_BASE}-${archvar}.conf 62 echo $pkgdir/solvedb >> ${rpmconf_base}-${archvar}.conf
53 if [ -d $pkgdir/solvedb ]; then 63 if [ -d $pkgdir/solvedb ]; then
54 # We've already processed this and it's a duplicate 64 # We've already processed this and it's a duplicate
55 continue 65 continue
@@ -65,27 +75,6 @@ package_update_index_rpm () {
65 $pkgdir/solvedb/manifest 75 $pkgdir/solvedb/manifest
66 fi 76 fi
67 done 77 done
68
69 cat /dev/null > ${RPMCONF_HOST_BASE}-${archvar}.conf
70 for pkgdir in $packagedirs_sdk; do
71 if [ -e $pkgdir/ ]; then
72 echo "Generating solve db for $pkgdir..."
73 echo $pkgdir/solvedb >> ${RPMCONF_HOST_BASE}-${archvar}.conf
74 if [ -d $pkgdir/solvedb ]; then
75 # We've already processed this and it's a duplicate
76 continue
77 fi
78 mkdir -p $pkgdir/solvedb
79 echo "# Dynamically generated solve manifest" >> $pkgdir/solvedb/manifest
80 find $pkgdir -maxdepth 1 -type f >> $pkgdir/solvedb/manifest
81 ${RPM} -i --replacepkgs --replacefiles --oldpackage \
82 -D "_dbpath $pkgdir/solvedb" --justdb \
83 --noaid --nodeps --noorder --noscripts --notriggers --noparentdirs --nolinktos --stats \
84 --ignoresize --nosignature --nodigest \
85 -D "__dbi_txn create nofsync" \
86 $pkgdir/solvedb/manifest
87 fi
88 done
89 done 78 done
90} 79}
91 80
@@ -94,45 +83,38 @@ package_update_index_rpm () {
94# generated depsolver db's... 83# generated depsolver db's...
95# 84#
96package_generate_rpm_conf () { 85package_generate_rpm_conf () {
97 printf "_solve_dbpath " > ${RPMCONF_TARGET_BASE}.macro 86 # Update target packages
98 o_colon_t=false 87 package_generate_rpm_conf_common "${RPMCONF_TARGET_BASE}" base_archs ml_archs
99 o_colon_h=false
100 88
101 for archvar in base_package_archs ml_package_archs; do 89 # Update SDK packages
102 printf "_solve_dbpath " > ${RPMCONF_TARGET_BASE}-${archvar}.macro 90 package_generate_rpm_conf_common "${RPMCONF_HOST_BASE}" base_archs
103 colon=false 91}
104 for each in `cat ${RPMCONF_TARGET_BASE}-${archvar}.conf` ; do 92
105 if [ "$o_colon_t" == true ]; then 93package_generate_rpm_conf_common() {
106 printf ":" >> ${RPMCONF_TARGET_BASE}.macro 94 rpmconf_base="$1"
107 fi 95 shift
108 if [ "$colon" == true ]; then 96
109 printf ":" >> ${RPMCONF_TARGET_BASE}-${archvar}.macro 97 printf "_solve_dbpath " > ${rpmconf_base}.macro
110 fi 98 o_colon=false
111 printf "%s" $each >> ${RPMCONF_TARGET_BASE}.macro
112 o_colon_t=true
113 printf "%s" $each >> ${RPMCONF_TARGET_BASE}-${archvar}.macro
114 colon=true
115 done
116 printf "\n" >> ${RPMCONF_TARGET_BASE}-${archvar}.macro
117 99
118 printf "_solve_dbpath " > ${RPMCONF_HOST_BASE}-${archvar}.macro 100 for archvar in "$@"; do
101 printf "_solve_dbpath " > ${rpmconf_base}-${archvar}.macro
119 colon=false 102 colon=false
120 for each in `cat ${RPMCONF_HOST_BASE}-${archvar}.conf` ; do 103 for each in `cat ${rpmconf_base}-${archvar}.conf` ; do
121 if [ "$o_colon_h" == true ]; then 104 if [ "$o_colon" == true ]; then
122 printf ":" >> ${RPMCONF_HOST_BASE}.macro 105 printf ":" >> ${rpmconf_base}.macro
123 fi 106 fi
124 if [ "$colon" == true ]; then 107 if [ "$colon" == true ]; then
125 printf ":" >> ${RPMCONF_HOST_BASE}-${archvar}.macro 108 printf ":" >> ${rpmconf_base}-${archvar}.macro
126 fi 109 fi
127 printf "%s" $each >> ${RPMCONF_HOST_BASE}.macro 110 printf "%s" $each >> ${rpmconf_base}.macro
128 o_colon_h=true 111 o_colon=true
129 printf "%s" $each >> ${RPMCONF_HOST_BASE}-${archvar}.macro 112 printf "%s" $each >> ${rpmconf_base}-${archvar}.macro
130 colon=true 113 colon=true
131 done 114 done
132 printf "\n" >> ${RPMCONF_HOST_BASE}-${archvar}.macro 115 printf "\n" >> ${rpmconf_base}-${archvar}.macro
133 done 116 done
134 printf "\n" >> ${RPMCONF_TARGET_BASE}.macro 117 printf "\n" >> ${rpmconf_base}.macro
135 printf "\n" >> ${RPMCONF_HOST_BASE}.macro
136} 118}
137 119
138rpm_log_check() { 120rpm_log_check() {
@@ -211,7 +193,7 @@ package_install_internal_rpm () {
211 mkdir -p ${target_rootfs}/etc/rpm/sysinfo 193 mkdir -p ${target_rootfs}/etc/rpm/sysinfo
212 echo "/" >${target_rootfs}/etc/rpm/sysinfo/Dirnames 194 echo "/" >${target_rootfs}/etc/rpm/sysinfo/Dirnames
213 if [ ! -z "$providename" ]; then 195 if [ ! -z "$providename" ]; then
214 >>${target_rootfs}/etc/rpm/sysinfo/Providename 196 cat /dev/null > ${target_rootfs}/etc/rpm/sysinfo/Providename
215 for provide in $providename ; do 197 for provide in $providename ; do
216 echo $provide >> ${target_rootfs}/etc/rpm/sysinfo/Providename 198 echo $provide >> ${target_rootfs}/etc/rpm/sysinfo/Providename
217 done 199 done
@@ -227,10 +209,10 @@ package_install_internal_rpm () {
227 for pkg in ${package_linguas}; do 209 for pkg in ${package_linguas}; do
228 echo "Processing $pkg..." 210 echo "Processing $pkg..."
229 211
230 archvar=base_package_archs 212 archvar=base_archs
231 ml_pkg=$(echo ${pkg} | sed "s,^${MLPREFIX}\(.*\),\1,") 213 ml_pkg=$(echo ${pkg} | sed "s,^${MLPREFIX}\(.*\),\1,")
232 if [ "${ml_pkg}" != "${pkg}" ]; then 214 if [ "${ml_pkg}" != "${pkg}" ]; then
233 archvar=ml_package_archs 215 archvar=ml_archs
234 fi 216 fi
235 217
236 pkg_name=$(resolve_package_rpm ${confbase}-${archvar}.conf ${ml_pkg}) 218 pkg_name=$(resolve_package_rpm ${confbase}-${archvar}.conf ${ml_pkg})
@@ -238,7 +220,7 @@ package_install_internal_rpm () {
238 echo "Unable to find package $pkg ($ml_pkg)!" 220 echo "Unable to find package $pkg ($ml_pkg)!"
239 exit 1 221 exit 1
240 fi 222 fi
241 echo $pkg_name >> ${IMAGE_ROOTFS}/install/install.manifest 223 echo $pkg_name >> ${target_rootfs}/install/install.manifest
242 done 224 done
243 fi 225 fi
244 fi 226 fi
@@ -247,10 +229,10 @@ package_install_internal_rpm () {
247 for pkg in ${package_to_install} ; do 229 for pkg in ${package_to_install} ; do
248 echo "Processing $pkg..." 230 echo "Processing $pkg..."
249 231
250 archvar=base_package_archs 232 archvar=base_archs
251 ml_pkg=$(echo ${pkg} | sed "s,^${MLPREFIX}\(.*\),\1,") 233 ml_pkg=$(echo ${pkg} | sed "s,^${MLPREFIX}\(.*\),\1,")
252 if [ "${ml_pkg}" != "${pkg}" ]; then 234 if [ "${ml_pkg}" != "${pkg}" ]; then
253 archvar=ml_package_archs 235 archvar=ml_archs
254 fi 236 fi
255 237
256 pkg_name=$(resolve_package_rpm ${confbase}-${archvar}.conf ${ml_pkg}) 238 pkg_name=$(resolve_package_rpm ${confbase}-${archvar}.conf ${ml_pkg})
@@ -258,7 +240,7 @@ package_install_internal_rpm () {
258 echo "Unable to find package $pkg ($ml_pkg)!" 240 echo "Unable to find package $pkg ($ml_pkg)!"
259 exit 1 241 exit 1
260 fi 242 fi
261 echo $pkg_name >> ${IMAGE_ROOTFS}/install/install.manifest 243 echo $pkg_name >> ${target_rootfs}/install/install.manifest
262 done 244 done
263 fi 245 fi
264 246
@@ -303,7 +285,7 @@ package_install_internal_rpm () {
303 # Dump the full set of recommends... 285 # Dump the full set of recommends...
304 ${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \ 286 ${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
305 --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \ 287 --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
306 -D "_dbpath ${IMAGE_ROOTFS}/install" -D "`cat ${confbase}.macro`" \ 288 -D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}.macro`" \
307 -D "__dbi_txn create nofsync private" \ 289 -D "__dbi_txn create nofsync private" \
308 -qa --qf "[%{RECOMMENDS}\n]" | sort -u > ${target_rootfs}/install/recommend 290 -qa --qf "[%{RECOMMENDS}\n]" | sort -u > ${target_rootfs}/install/recommend
309 # Did we add more to the list? 291 # Did we add more to the list?