summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/bootfs-image.bbclass2
-rw-r--r--classes/local-sources.bbclass81
2 files changed, 82 insertions, 1 deletions
diff --git a/classes/bootfs-image.bbclass b/classes/bootfs-image.bbclass
index e5694e8..7203b01 100644
--- a/classes/bootfs-image.bbclass
+++ b/classes/bootfs-image.bbclass
@@ -36,7 +36,7 @@ fakeroot do_bootfs () {
36 src=`echo $item | awk -F':' '{ print $1 }'` 36 src=`echo $item | awk -F':' '{ print $1 }'`
37 dst=`echo $item | awk -F':' '{ print $2 }'` 37 dst=`echo $item | awk -F':' '{ print $2 }'`
38 38
39 install -m 0755 ${DEPLOY_DIR_IMAGE}/$src ${S}/bootfs/$dst 39 install -D -m 0755 ${DEPLOY_DIR_IMAGE}/$src ${S}/bootfs/$dst
40 done 40 done
41 41
42 cd ${S}/bootfs 42 cd ${S}/bootfs
diff --git a/classes/local-sources.bbclass b/classes/local-sources.bbclass
new file mode 100644
index 0000000..b7c68fb
--- /dev/null
+++ b/classes/local-sources.bbclass
@@ -0,0 +1,81 @@
1#############################################################################
2##
3## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4##
5## This file is part of the Qt Enterprise Embedded Scripts of the Qt
6## framework.
7##
8## $QT_BEGIN_LICENSE$
9## Commercial License Usage Only
10## Licensees holding valid commercial Qt license agreements with Digia
11## with an appropriate addendum covering the Qt Enterprise Embedded Scripts,
12## may use this file in accordance with the terms contained in said license
13## agreement.
14##
15## For further information use the contact form at
16## http://www.qt.io/contact-us.
17##
18##
19## $QT_END_LICENSE$
20##
21#############################################################################
22
23python do_fetch () {
24 src_uri = (d.getVar('SRC_URI', True) or "").split()
25 if len(src_uri) == 0:
26 return
27
28 sdk_path = d.getVar('QT_SDK_PATH', True) or ""
29 if len(sdk_path) != 0:
30 uris = list(src_uri);
31 for url in uris:
32 ud = list(bb.fetch2.decodeurl(url))
33 if ("local-uri" in ud[5]):
34 src_uri.remove(url)
35
36 try:
37 fetcher = bb.fetch2.Fetch(src_uri, d)
38 fetcher.download()
39 except bb.fetch2.BBFetchException as e:
40 raise bb.build.FuncFailed(e)
41}
42
43python do_unpack () {
44 src_uri = (d.getVar('SRC_URI', True) or "").split()
45 if len(src_uri) == 0:
46 return
47
48 rootdir = d.getVar('WORKDIR', True)
49
50 sdk_path = d.getVar('QT_SDK_PATH', True) or ""
51 if len(sdk_path) != 0:
52 uris = list(src_uri);
53 for url in uris:
54 ud = list(bb.fetch2.decodeurl(url))
55 if ("local-uri" in ud[5]):
56 unpack_local_uri(ud, d)
57 src_uri.remove(url)
58
59 try:
60 fetcher = bb.fetch2.Fetch(src_uri, d)
61 fetcher.unpack(rootdir)
62 except bb.fetch2.BBFetchException as e:
63 raise bb.build.FuncFailed(e)
64}
65
66def unpack_local_uri(ud, d):
67 import subprocess
68 rootdir = d.getVar('WORKDIR', True)
69 sdk_path = d.getVar('QT_SDK_PATH', True)
70
71 destdir = os.path.join(rootdir, ud[5].get("destsuffix", "git"))
72 srcdir = os.path.join(sdk_path, ud[5].get("local-uri"))
73 cmd = "cp -vrf %s %s" % (srcdir, destdir)
74
75 if os.path.exists(destdir):
76 bb.utils.prunedir(destdir)
77
78 ret = subprocess.call(cmd, shell=True)
79
80 if ret != 0:
81 raise bb.fetch.UnpackError("Unpack command %s failed with return value %s" % (cmd, ret), ud)