summaryrefslogtreecommitdiff
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-07-08 00:51:51 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2009-07-08 00:51:51 +0100
commit2b7886853c16ebffce2582ec9a9734ed98324fac (patch)
treefe0ae2bcb229ce71afa6639225b964b2c8fecc77 /meta/classes
parente7f1993e3ba682af214f6a4c69475636e294d76c (diff)
downloadopenembedded-core-2b7886853c16ebffce2582ec9a9734ed98324fac.tar.gz
openembedded-core-2b7886853c16ebffce2582ec9a9734ed98324fac.tar.bz2
openembedded-core-2b7886853c16ebffce2582ec9a9734ed98324fac.tar.xz
openembedded-core-2b7886853c16ebffce2582ec9a9734ed98324fac.zip
package_ipk.bbclass: Solve opkg-make-index locking problem using flock
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/package_ipk.bbclass18
1 files changed, 8 insertions, 10 deletions
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 1aa2c814b..f0c158033 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -73,17 +73,15 @@ package_update_index_ipk () {
return
fi
- touch ${DEPLOY_DIR_IPK}/Packages
- opkg-make-index -r ${DEPLOY_DIR_IPK}/Packages -p ${DEPLOY_DIR_IPK}/Packages -l ${DEPLOY_DIR_IPK}/Packages.filelist -m ${DEPLOY_DIR_IPK}
-
+ packagedirs="${DEPLOY_DIR_IPK}"
for arch in $ipkgarchs; do
- if [ -e ${DEPLOY_DIR_IPK}/$arch/ ] ; then
- touch ${DEPLOY_DIR_IPK}/$arch/Packages
- opkg-make-index -r ${DEPLOY_DIR_IPK}/$arch/Packages -p ${DEPLOY_DIR_IPK}/$arch/Packages -l ${DEPLOY_DIR_IPK}/$arch/Packages.filelist -m ${DEPLOY_DIR_IPK}/$arch/
- fi
- if [ -e ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/ ] ; then
- touch ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/Packages
- opkg-make-index -r ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/Packages -p ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/Packages -l ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/Packages.filelist -m ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/
+ packagedirs="$packagedirs ${DEPLOY_DIR_IPK}/$arch ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk"
+ done
+
+ for pkgdir in $packagedirs; do
+ if [ -e $pkgdir/ ]; then
+ touch $pkgdir/Packages
+ flock $pkgdir/Packages.flock -c "opkg-make-index -r $pkgdir/Packages -p $pkgdir/Packages -l $pkgdir/Packages.filelist -m $pkgdir/"
fi
done
}