1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-03 13:49:49 +00:00

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.

(From OE-Core rev: 3021136e7b42ab64ca16f30c88467c4b00d51ee0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2012-02-09 14:09:18 +00:00
parent 53cf1a8977
commit 4a0c704c80
2 changed files with 67 additions and 14 deletions
+4 -14
View File
@@ -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
}
#