summaryrefslogtreecommitdiffstats
path: root/openembedded/classes/pkg_distribute.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2005-08-31 10:45:47 +0000
committerRichard Purdie <richard@openedhand.com>2005-08-31 10:45:47 +0000
commit4b46c1f6e891b1ddd5968536440b888661fade3e (patch)
treee0ba2c1f56f61b868bf746da5c4feabb25b800b2 /openembedded/classes/pkg_distribute.bbclass
downloadpoky-4b46c1f6e891b1ddd5968536440b888661fade3e.tar.gz
Initial population
git-svn-id: https://svn.o-hand.com/repos/poky@1 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'openembedded/classes/pkg_distribute.bbclass')
-rw-r--r--openembedded/classes/pkg_distribute.bbclass29
1 files changed, 29 insertions, 0 deletions
diff --git a/openembedded/classes/pkg_distribute.bbclass b/openembedded/classes/pkg_distribute.bbclass
new file mode 100644
index 0000000000..81978e3e3b
--- /dev/null
+++ b/openembedded/classes/pkg_distribute.bbclass
@@ -0,0 +1,29 @@
1PKG_DISTRIBUTECOMMAND[func] = "1"
2python do_distribute_packages () {
3 cmd = bb.data.getVar('PKG_DISTRIBUTECOMMAND', d, 1)
4 if not cmd:
5 raise bb.build.FuncFailed("Unable to distribute packages, PKG_DISTRIBUTECOMMAND not defined")
6 bb.build.exec_func('PKG_DISTRIBUTECOMMAND', d)
7}
8
9addtask distribute_packages before do_build after do_fetch
10
11PKG_DIST_LOCAL ?= "symlink"
12PKG_DISTRIBUTEDIR ?= "${DEPLOY_DIR}/packages"
13
14PKG_DISTRIBUTECOMMAND () {
15 p=`dirname ${FILE}`
16 d=`basename $p`
17 mkdir -p ${PKG_DISTRIBUTEDIR}
18 case "${PKG_DIST_LOCAL}" in
19 copy)
20 # use this weird tar command to copy because we want to
21 # exclude the BitKeeper directories
22 test -e ${PKG_DISTRIBUTEDIR}/${d} || mkdir ${PKG_DISTRIBUTEDIR}/${d};
23 (cd ${p}; tar -c --exclude SCCS -f - . ) | tar -C ${PKG_DISTRIBUTEDIR}/${d} -xpf -
24 ;;
25 symlink)
26 ln -sf $p ${PKG_DISTRIBUTEDIR}/
27 ;;
28 esac
29}