DEPLOY_DIR_SRC ?= "${DEPLOY_DIR}/source" EXCLUDE_FROM ?= ".pc autom4te.cache" # used as part of a path. make sure it's set DISTRO ?= "openembedded" def get_src_tree(d): import bb import os, os.path workdir = bb.data.getVar('WORKDIR', d, 1) if not workdir: bb.error("WORKDIR not defined, unable to find source tree.") return s = bb.data.getVar('S', d, 0) if not s: bb.error("S not defined, unable to find source tree.") return s_tree_raw = s.split('/')[1] s_tree = bb.data.expand(s_tree_raw, d) src_tree_path = os.path.join(workdir, s_tree) try: os.listdir(src_tree_path) except OSError: bb.fatal("Expected to find source tree in '%s' which doesn't exist." % src_tree_path) bb.debug("Assuming source tree is '%s'" % src_tree_path) return s_tree sourcepkg_do_create_orig_tgz(){ mkdir -p ${DEPLOY_DIR_SRC} cd ${WORKDIR} for i in ${EXCLUDE_FROM}; do echo $i >> temp/exclude-from-file done src_tree=${@get_src_tree(d)} echo $src_tree oenote "Creating .orig.tar.gz in ${DEPLOY_DIR_SRC}/${P}.orig.tar.gz" tar cvzf ${DEPLOY_DIR_SRC}/${P}.orig.tar.gz --exclude-from temp/exclude-from-file $src_tree cp -pPR $src_tree $src_tree.orig } sourcepkg_do_archive_bb() { src_tree=${@get_src_tree(d)} dest=${WORKDIR}/$src_tree/${DISTRO} mkdir -p $dest cp ${FILE} $dest } python sourcepkg_do_dumpdata() { import os import os.path workdir = bb.data.getVar('WORKDIR', d, 1) distro = bb.data.getVar('DISTRO', d, 1) s_tree = get_src_tree(d) openembeddeddir = os.path.join(workdir, s_tree, distro) dumpfile = os.path.join(openembeddeddir, bb.data.expand("${P}-${PR}.showdata.dump",d)) try: os.mkdir(openembeddeddir) except OSError: # dir exists pass bb.note("Dumping metadata into '%s'" % dumpfile) f = open(dumpfile, "w") # emit variables and shell functions bb.data.emit_env(f, d, True) # emit the metadata which isnt valid shell for e in d.keys(): if bb.data.getVarFlag(e, 'python', d): f.write("\npython %s () {\n%s}\n" % (e, bb.data.getVar(e, d, 1))) f.close() } sourcepkg_do_create_diff_gz(){ cd ${WORKDIR} for i in ${EXCLUDE_FROM}; do echo $i >> temp/exclude-from-file done src_tree=${@get_src_tree(d)} for i in `find . -maxdepth 1 -type f`; do mkdir -p $src_tree/${DISTRO}/files cp $i $src_tree/${DISTRO}/files done oenote "Creating .diff.gz in ${DEPLOY_DIR_SRC}/${P}-${PR}.diff.gz" LC_ALL=C TZ=UTC0 diff --exclude-from=temp/exclude-from-file -Naur $src_tree.orig $src_tree | gzip -c > ${DEPLOY_DIR_SRC}/${P}-${PR}.diff.gz rm -rf $src_tree.orig } EXPORT_FUNCTIONS do_create_orig_tgz do_archive_bb do_dumpdata do_create_diff_gz addtask create_orig_tgz after do_unpack before do_patch addtask archive_bb after do_patch before do_dumpdata addtask dumpdata after archive_bb before do_create_diff_gz addtask create_diff_gz after do_dump_data before do_configure core.git/tree/?id=17f7f3a43e863d9e2a16dd02face5137a4f4b225'>root/meta/files/common-licenses/APSL-1.1
blob: 425e46e21593320c7524f75703a6a1ab2ebfa726 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374