Update drivers
[vuplus_openembedded] / classes / src_distribute_local.bbclass
1 inherit src_distribute
2
3 SRC_DIST_LOCAL ?= "move+symlink"
4 SRC_DISTRIBUTEDIR ?= "${DEPLOY_DIR}/sources"
5 SRC_DISTRIBUTECOMMAND[dirs] = "${SRC_DISTRIBUTEDIR}/${LIC}/${PN}"
6
7 # symlinks the files to the SRC_DISTRIBUTEDIR
8 SRC_DISTRIBUTECOMMAND-symlink () {
9     test -e ${SRC}.md5 && ln -sf ${SRC}.md5 .
10     ln -sf ${SRC} .
11 }
12
13 # copies the files to the SRC_DISTRIBUTEDIR
14 SRC_DISTRIBUTECOMMAND-copy () {
15     test -e ${SRC}.md5 && cp -f ${SRC}.md5 .
16     cp -fr ${SRC} .
17 }
18
19 # moves the files to the SRC_DISTRIBUTEDIR and symlinks them back
20 SRC_DISTRIBUTECOMMAND-move+symlink () {
21     if ! [ -L ${SRC} ]; then
22         mv ${SRC} .
23         ln -sf $PWD/`basename ${SRC}` ${SRC}
24         if [ -e ${SRC}.md5 ]; then
25             mv ${SRC}.md5 .
26             ln -sf $PWD/`basename ${SRC}.md5` ${SRC}.md5
27         fi
28     fi
29 }
30
31 #SRC_DISTRIBUTECOMMAND = "${@str(d.getVar('SRC_DISTRIBUTECOMMAND-%s' % d.getVar('SRC_DIST_LOCAL', 1), 1))}"
32 python () {
33     if d.getVar("SRC_DISTRIBUTECOMMAND", 1) is None:
34         cmd = d.getVar("SRC_DISTRIBUTECOMMAND-%s" % d.getVar("SRC_DIST_LOCAL", 1), 0)
35         if cmd:
36             d.setVar("SRC_DISTRIBUTECOMMAND", cmd)
37 }