From 4b46c1f6e891b1ddd5968536440b888661fade3e Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 31 Aug 2005 10:45:47 +0000 Subject: Initial population git-svn-id: https://svn.o-hand.com/repos/poky@1 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- openembedded/classes/pkg_distribute.bbclass | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 openembedded/classes/pkg_distribute.bbclass (limited to 'openembedded/classes/pkg_distribute.bbclass') diff --git a/openembedded/classes/pkg_distribute.bbclass b/openembedded/classes/pkg_distribute.bbclass new file mode 100644 index 000000000..81978e3e3 --- /dev/null +++ b/openembedded/classes/pkg_distribute.bbclass @@ -0,0 +1,29 @@ +PKG_DISTRIBUTECOMMAND[func] = "1" +python do_distribute_packages () { + cmd = bb.data.getVar('PKG_DISTRIBUTECOMMAND', d, 1) + if not cmd: + raise bb.build.FuncFailed("Unable to distribute packages, PKG_DISTRIBUTECOMMAND not defined") + bb.build.exec_func('PKG_DISTRIBUTECOMMAND', d) +} + +addtask distribute_packages before do_build after do_fetch + +PKG_DIST_LOCAL ?= "symlink" +PKG_DISTRIBUTEDIR ?= "${DEPLOY_DIR}/packages" + +PKG_DISTRIBUTECOMMAND () { + p=`dirname ${FILE}` + d=`basename $p` + mkdir -p ${PKG_DISTRIBUTEDIR} + case "${PKG_DIST_LOCAL}" in + copy) + # use this weird tar command to copy because we want to + # exclude the BitKeeper directories + test -e ${PKG_DISTRIBUTEDIR}/${d} || mkdir ${PKG_DISTRIBUTEDIR}/${d}; + (cd ${p}; tar -c --exclude SCCS -f - . ) | tar -C ${PKG_DISTRIBUTEDIR}/${d} -xpf - + ;; + symlink) + ln -sf $p ${PKG_DISTRIBUTEDIR}/ + ;; + esac +} -- cgit v1.2.3