From 59a3e98b044d3157e7472d35b1439a4a292c6693 Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Sat, 21 Aug 2010 22:44:21 -0700 Subject: rootfs_rpm: Enable multi dep solverdbs Update package_rpm.bbclass to generate dep solver databases for each package arch. Following the example of the deb and ipk integration Revise the rootfs_rpm to solve the installation based on the multiple dep solvers. Note, recommends, locale and attemptonly pckages are still to be implemented. Signed-off-by: Mark Hatle --- meta/classes/package_rpm.bbclass | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'meta/classes/package_rpm.bbclass') diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index 3334c9ae6..f89fd9472 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass @@ -15,6 +15,57 @@ python package_rpm_install () { bb.fatal("package_rpm_install not implemented!") } +# +# Update the Packages depsolver db in ${DEPLOY_DIR_RPM} +# +package_update_index_rpm () { + rpmarchs="${PACKAGE_ARCHS}" + + if [ ! -z "${DEPLOY_KEEP_PACKAGES}" ]; then + return + fi + + packagedirs="" + for arch in $rpmarchs ; do + sdkarch=`echo $arch | sed -e 's/${HOST_ARCH}/${SDK_ARCH}/'` + packagedirs="$packagedirs ${DEPLOY_DIR_RPM}/$arch ${DEPLOY_DIR_RPM}/$sdkarch-nativesdk" + done + + packagedirs="$packagedirs ${DEPLOY_DIR_RPM}/${SDK_ARCH}-${TARGET_ARCH}-canadian" + + cat /dev/null > ${DEPLOY_DIR_RPM}/solvedb.conf + for pkgdir in $packagedirs; do + if [ -e $pkgdir/ ]; then + rm -rf $pkgdir/solvedb + mkdir -p $pkgdir/solvedb + echo "# Dynamically generated solve manifest" >> $pkgdir/solvedb/manifest + find $pkgdir -maxdepth 1 -type f >> $pkgdir/solvedb/manifest + ${RPM} -i --replacepkgs --replacefiles --oldpackage \ + -D "_dbpath $pkgdir/solvedb" --justdb \ + --noaid --nodeps --noorder --noscripts --notriggers --noparentdirs --nolinktos --stats \ + $pkgdir/solvedb/manifest + echo $pkgdir/solvedb >> ${DEPLOY_DIR_RPM}/solvedb.conf + fi + done +} + +# +# Generate an rpm configuration suitable for use against the +# generated depsolver db's... +# +package_generate_rpm_conf () { + printf "_solve_dbpath " > ${DEPLOY_DIR_RPM}/solvedb.macro + colon=false + for each in `cat ${DEPLOY_DIR_RPM}/solvedb.conf` ; do + if [ "$colon" == true ]; then + printf ":" >> ${DEPLOY_DIR_RPM}/solvedb.macro + fi + printf "%s" $each >> ${DEPLOY_DIR_RPM}/solvedb.macro + colon=true + done + printf "\n" >> ${DEPLOY_DIR_RPM}/solvedb.macro +} + python write_specfile () { # We need to change '-' in a version field to '+' # This needs to be done BEFORE the mapping_rename_hook -- cgit v1.2.3