From 3021136e7b42ab64ca16f30c88467c4b00d51ee0 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 9 Feb 2012 14:09:18 +0000 Subject: package_rpm: Only rebuild the indexes if the packages have changed This change farms the solvedb creation out to a separate script which handles creation of the index, only if mtime of any of the packages has changed. For a core-image-minimal set of rpm's this saves ~20s of a 45s rootfs build. For core-image-sato it saves 1 minute of a 5 minute rootfs build. The more packages in the system, the bigger the saving will be. Signed-off-by: Richard Purdie --- meta/classes/package_rpm.bbclass | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'meta/classes') diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index d90976b65d..623069e377 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass @@ -40,12 +40,13 @@ package_update_index_rpm_common () { rpmconf_base="$1" shift + createdirs="" for archvar in "$@"; do eval archs=\${${archvar}} packagedirs="" for arch in $archs; do packagedirs="${DEPLOY_DIR_RPM}/$arch $packagedirs" - rm -rf ${DEPLOY_DIR_RPM}/$arch/solvedb + rm -rf ${DEPLOY_DIR_RPM}/$arch/solvedb.done done cat /dev/null > ${rpmconf_base}-${archvar}.conf @@ -53,22 +54,11 @@ package_update_index_rpm_common () { if [ -e $pkgdir/ ]; then echo "Generating solve db for $pkgdir..." echo $pkgdir/solvedb >> ${rpmconf_base}-${archvar}.conf - if [ -d $pkgdir/solvedb ]; then - # We've already processed this and it's a duplicate - continue - fi - 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 \ - --ignoresize --nosignature --nodigest \ - -D "__dbi_txn create nofsync" \ - $pkgdir/solvedb/manifest + createdirs="$createdirs $pkgdir" fi done done + rpm-createsolvedb.py "${RPM}" $createdirs } # -- cgit 1.2.3-korg