summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_rpm.bbclass
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2011-02-15 22:56:13 -0600
committerSaul Wold <sgw@linux.intel.com>2011-02-16 07:34:51 -0800
commitab0e1bed22b5054db5a2b62862134ad3b0714181 (patch)
tree291945a5f5260eb8e75186b8f31af06a54761fc4 /meta/classes/package_rpm.bbclass
parent110f1f9418ba39ba4136d7aa7c3d52c2a10f47f0 (diff)
downloadpoky-ab0e1bed22b5054db5a2b62862134ad3b0714181.tar.gz
package_rpm: Fix solverdb generation
The RPM solverdb was potentially being generated multiple times. Fix this by ensuring we only process each directory once. Also correct an issue where the solution did not necessarily follow the preferred architecture ordering, reverse the default Poky ordering so that preferred is listed first. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r--meta/classes/package_rpm.bbclass32
1 files changed, 19 insertions, 13 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 215be8d607..7cbdae6256 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -35,15 +35,22 @@ package_update_index_rpm () {
35 if [ "$sdkarch" = "all" -o "$sdkarch" = "any" -o "$sdkarch" = "noarch" ]; then 35 if [ "$sdkarch" = "all" -o "$sdkarch" = "any" -o "$sdkarch" = "noarch" ]; then
36 extension="" 36 extension=""
37 fi 37 fi
38 packagedirs="$packagedirs ${DEPLOY_DIR_RPM}/$arch" 38 packagedirs="${DEPLOY_DIR_RPM}/$arch $packagedirs"
39 packagedirs_sdk="$packagedirs_sdk ${DEPLOY_DIR_RPM}/$sdkarch$extension" 39 packagedirs_sdk="${DEPLOY_DIR_RPM}/$sdkarch$extension $packagedirs_sdk"
40
41 rm -rf ${DEPLOY_DIR_RPM}/$arch/solvedb
42 rm -rf ${DEPLOY_DIR_RPM}/$sdkarch$extension/solvedb
40 done 43 done
41 44
42 cat /dev/null > ${RPMCONF_TARGET_BASE}.conf 45 cat /dev/null > ${RPMCONF_TARGET_BASE}.conf
43 for pkgdir in $packagedirs; do 46 for pkgdir in $packagedirs; do
44 if [ -e $pkgdir/ ]; then 47 if [ -e $pkgdir/ ]; then
45 echo "Generating solve db for $pkgdir..." 48 echo "Generating solve db for $pkgdir..."
46 rm -rf $pkgdir/solvedb 49 echo $pkgdir/solvedb >> ${RPMCONF_TARGET_BASE}.conf
50 if [ -d $pkgdir/solvedb ]; then
51 # We've already processed this and it's a duplicate
52 continue
53 fi
47 mkdir -p $pkgdir/solvedb 54 mkdir -p $pkgdir/solvedb
48 echo "# Dynamically generated solve manifest" >> $pkgdir/solvedb/manifest 55 echo "# Dynamically generated solve manifest" >> $pkgdir/solvedb/manifest
49 find $pkgdir -maxdepth 1 -type f >> $pkgdir/solvedb/manifest 56 find $pkgdir -maxdepth 1 -type f >> $pkgdir/solvedb/manifest
@@ -53,7 +60,6 @@ package_update_index_rpm () {
53 --ignoresize --nosignature --nodigest \ 60 --ignoresize --nosignature --nodigest \
54 -D "__dbi_txn create nofsync" \ 61 -D "__dbi_txn create nofsync" \
55 $pkgdir/solvedb/manifest 62 $pkgdir/solvedb/manifest
56 echo $pkgdir/solvedb >> ${RPMCONF_TARGET_BASE}.conf
57 fi 63 fi
58 done 64 done
59 65
@@ -61,7 +67,11 @@ package_update_index_rpm () {
61 for pkgdir in $packagedirs_sdk; do 67 for pkgdir in $packagedirs_sdk; do
62 if [ -e $pkgdir/ ]; then 68 if [ -e $pkgdir/ ]; then
63 echo "Generating solve db for $pkgdir..." 69 echo "Generating solve db for $pkgdir..."
64 rm -rf $pkgdir/solvedb 70 echo $pkgdir/solvedb >> ${RPMCONF_HOST_BASE}.conf
71 if [ -d $pkgdir/solvedb ]; then
72 # We've already processed this and it's a duplicate
73 continue
74 fi
65 mkdir -p $pkgdir/solvedb 75 mkdir -p $pkgdir/solvedb
66 echo "# Dynamically generated solve manifest" >> $pkgdir/solvedb/manifest 76 echo "# Dynamically generated solve manifest" >> $pkgdir/solvedb/manifest
67 find $pkgdir -maxdepth 1 -type f >> $pkgdir/solvedb/manifest 77 find $pkgdir -maxdepth 1 -type f >> $pkgdir/solvedb/manifest
@@ -71,7 +81,6 @@ package_update_index_rpm () {
71 --ignoresize --nosignature --nodigest \ 81 --ignoresize --nosignature --nodigest \
72 -D "__dbi_txn create nofsync" \ 82 -D "__dbi_txn create nofsync" \
73 $pkgdir/solvedb/manifest 83 $pkgdir/solvedb/manifest
74 echo $pkgdir/solvedb >> ${RPMCONF_HOST_BASE}.conf
75 fi 84 fi
76 done 85 done
77} 86}
@@ -146,8 +155,7 @@ resolve_package_rpm () {
146# install a bunch of packages using rpm 155# install a bunch of packages using rpm
147# the following shell variables needs to be set before calling this func: 156# the following shell variables needs to be set before calling this func:
148# INSTALL_ROOTFS_RPM - install root dir 157# INSTALL_ROOTFS_RPM - install root dir
149# INSTALL_PLATFORM_RPM - main platform 158# INSTALL_PLATFORM_RPM - extra platform
150# INSTALL_PLATFORM_EXTRA_RPM - extra platform
151# INSTALL_CONFBASE_RPM - configuration file base name 159# INSTALL_CONFBASE_RPM - configuration file base name
152# INSTALL_PACKAGES_NORMAL_RPM - packages to be installed 160# INSTALL_PACKAGES_NORMAL_RPM - packages to be installed
153# INSTALL_PACKAGES_ATTEMPTONLY_RPM - packages attemped to be installed only 161# INSTALL_PACKAGES_ATTEMPTONLY_RPM - packages attemped to be installed only
@@ -158,8 +166,7 @@ resolve_package_rpm () {
158package_install_internal_rpm () { 166package_install_internal_rpm () {
159 167
160 local target_rootfs="${INSTALL_ROOTFS_RPM}" 168 local target_rootfs="${INSTALL_ROOTFS_RPM}"
161 local platform="${INSTALL_PLATFORM_RPM}" 169 local platforms="${INSTALL_PLATFORM_RPM}"
162 local platform_extra="${INSTALL_PLATFORM_EXTRA_RPM}"
163 local confbase="${INSTALL_CONFBASE_RPM}" 170 local confbase="${INSTALL_CONFBASE_RPM}"
164 local package_to_install="${INSTALL_PACKAGES_NORMAL_RPM}" 171 local package_to_install="${INSTALL_PACKAGES_NORMAL_RPM}"
165 local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_RPM}" 172 local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_RPM}"
@@ -169,9 +176,8 @@ package_install_internal_rpm () {
169 176
170 # Setup base system configuration 177 # Setup base system configuration
171 mkdir -p ${target_rootfs}/etc/rpm/ 178 mkdir -p ${target_rootfs}/etc/rpm/
172 echo "${platform}-unknown-linux" >${target_rootfs}/etc/rpm/platform 179 if [ ! -z "$platforms" ]; then
173 if [ ! -z "$platform_extra" ]; then 180 for pt in $platforms ; do
174 for pt in $platform_extra ; do
175 echo "$pt-unknown-linux" >> ${target_rootfs}/etc/rpm/platform 181 echo "$pt-unknown-linux" >> ${target_rootfs}/etc/rpm/platform
176 done 182 done
177 fi 183 fi