diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-02-09 14:09:18 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-04-30 11:37:30 +0100 |
commit | 4a0c704c803d927fc8c5574453c8e37b838af8b2 (patch) | |
tree | 57213863747b03ddf318a2102cf09403762d5733 /meta/classes | |
parent | 53cf1a8977691827ace66ecc4aa5bf4b4a13d9f1 (diff) | |
download | poky-4a0c704c803d927fc8c5574453c8e37b838af8b2.tar.gz |
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>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/package_rpm.bbclass | 18 |
1 files changed, 4 insertions, 14 deletions
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 () { | |||
40 | rpmconf_base="$1" | 40 | rpmconf_base="$1" |
41 | shift | 41 | shift |
42 | 42 | ||
43 | createdirs="" | ||
43 | for archvar in "$@"; do | 44 | for archvar in "$@"; do |
44 | eval archs=\${${archvar}} | 45 | eval archs=\${${archvar}} |
45 | packagedirs="" | 46 | packagedirs="" |
46 | for arch in $archs; do | 47 | for arch in $archs; do |
47 | packagedirs="${DEPLOY_DIR_RPM}/$arch $packagedirs" | 48 | packagedirs="${DEPLOY_DIR_RPM}/$arch $packagedirs" |
48 | rm -rf ${DEPLOY_DIR_RPM}/$arch/solvedb | 49 | rm -rf ${DEPLOY_DIR_RPM}/$arch/solvedb.done |
49 | done | 50 | done |
50 | 51 | ||
51 | cat /dev/null > ${rpmconf_base}-${archvar}.conf | 52 | cat /dev/null > ${rpmconf_base}-${archvar}.conf |
@@ -53,22 +54,11 @@ package_update_index_rpm_common () { | |||
53 | if [ -e $pkgdir/ ]; then | 54 | if [ -e $pkgdir/ ]; then |
54 | echo "Generating solve db for $pkgdir..." | 55 | echo "Generating solve db for $pkgdir..." |
55 | echo $pkgdir/solvedb >> ${rpmconf_base}-${archvar}.conf | 56 | echo $pkgdir/solvedb >> ${rpmconf_base}-${archvar}.conf |
56 | if [ -d $pkgdir/solvedb ]; then | 57 | createdirs="$createdirs $pkgdir" |
57 | # We've already processed this and it's a duplicate | ||
58 | continue | ||
59 | fi | ||
60 | mkdir -p $pkgdir/solvedb | ||
61 | echo "# Dynamically generated solve manifest" >> $pkgdir/solvedb/manifest | ||
62 | find $pkgdir -maxdepth 1 -type f >> $pkgdir/solvedb/manifest | ||
63 | ${RPM} -i --replacepkgs --replacefiles --oldpackage \ | ||
64 | -D "_dbpath $pkgdir/solvedb" --justdb \ | ||
65 | --noaid --nodeps --noorder --noscripts --notriggers --noparentdirs --nolinktos --stats \ | ||
66 | --ignoresize --nosignature --nodigest \ | ||
67 | -D "__dbi_txn create nofsync" \ | ||
68 | $pkgdir/solvedb/manifest | ||
69 | fi | 58 | fi |
70 | done | 59 | done |
71 | done | 60 | done |
61 | rpm-createsolvedb.py "${RPM}" $createdirs | ||
72 | } | 62 | } |
73 | 63 | ||
74 | # | 64 | # |