From b47f572122d09f6462952bb8d7d19ea47cce538a Mon Sep 17 00:00:00 2001 From: Matthias Hentges Date: Thu, 1 Mar 2007 02:06:34 +0000 Subject: rootfs_ipk.bbclass: Implements a sensational new feature called 'oe-feed' which, for the first time ever, actually lets you use your ipk deploy dir as a feed in ipkg.conf./mtcommit ../classes/rootfs_ipk.bbclass Oh wait......we already could do that in the past, now couldn't we?? Set DEPLOY_ENABLE_OEFEED=1 in your shell env or local.conf to activate fast oe-feed/Packages creation, set DEPLOY_ENABLE_OEFEED=2 to enable traditional (and slooooow) oe-feed/Packages creation. --- classes/rootfs_ipk.bbclass | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/classes/rootfs_ipk.bbclass b/classes/rootfs_ipk.bbclass index fdd42ee429..eeb2f3f4c4 100644 --- a/classes/rootfs_ipk.bbclass +++ b/classes/rootfs_ipk.bbclass @@ -31,6 +31,49 @@ rootfs_ipk_do_indexes () { fi fi done + + test "${DEPLOY_ENABLE_OEFEED}" -gt 0 && rootfs_create_combined_feed || /bin/true +} + +rootfs_create_combined_feed() { + + # Create deploy/oe-feed which can be used as a feed in ipkg.conf + # Set DEPLOY_ENABLE_OEFEED=2 to rebuild Packages with ipkg-make-index (very slow) + # Set DEPLOY_ENABLE_OEFEED=1 to use the Packages files from ipk/ARCH/ (fast) + + mkdir -p "${DEPLOY_DIR}/oe-feed" + cd "${DEPLOY_DIR}/oe-feed" || exit 1 + + # To catch deleted / changed packages, we have to completly rebuild + # the symlinks every time. + test -d "${DEPLOY_DIR}/oe-feed" && rm -rf "${DEPLOY_DIR}/oe-feed/" + + case "${DEPLOY_ENABLE_OEFEED}" in + 1) MAKE_INDEX_TYPE="fast" ;; + *) MAKE_INDEX_TYPE="traditional" ;; + esac + + for arch in $ipkgarchs + do + if test -d ${DEPLOY_DIR_IPK}/$arch/ + then + # Note: *.ipk won't work (too many arguments) + for ipk in `ls -1 "${DEPLOY_DIR_IPK}/$arch/" | grep ".ipk$"` + do + ln -s "${DEPLOY_DIR_IPK}/$arch/$ipk" . + done + fi + + # Doesn't get faster than that =) + test "$MAKE_INDEX_TYPE" = "fast" && cat ${DEPLOY_DIR_IPK}/$arch/Packages >> ./Packages + done + + if test "$MAKE_INDEX_TYPE" = "traditional" + then + rm -f ${DEPLOY_DIR}/oe-feed/Packages + touch ${DEPLOY_DIR}/oe-feed/Packages + ipkg-make-index -r ${DEPLOY_DIR}/oe-feed/Packages -p ${DEPLOY_DIR}/oe-feed/Packages -l ${DEPLOY_DIR}/oe-feed/Packages.filelist -m ${DEPLOY_DIR}/oe-feed/ + fi } fakeroot rootfs_ipk_do_rootfs () { -- cgit v1.2.3