From 2b7886853c16ebffce2582ec9a9734ed98324fac Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 8 Jul 2009 00:51:51 +0100 Subject: package_ipk.bbclass: Solve opkg-make-index locking problem using flock Signed-off-by: Richard Purdie --- meta/classes/package_ipk.bbclass | 18 ++++++++---------- 1 file 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 } -- cgit v1.2.3