-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_bitbake
670 lines (597 loc) · 25.8 KB
/
_bitbake
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
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
#compdef bitbake devtool
#
# zsh completion function for bitbake and devtool
# Options passed to _arguments.
__arguments_opts ()
{
print -- \
-s # option stacking
}
#
# bitbake
#
__bb_tasks()
{
local -a _bb_tasks
_bb_tasks=(
'build:default task for a recipe'
'checkuri:validates the src_uri value'
'clean:removes all output files for a target'
'cleanall:removes all output files, shared state cache, and downloaded source files for a target'
'cleansstate:removes all output files and shared state cache for a target'
'compile:compiles the source in the compilation directory'
'configure:configures the source by enabling and disabling any build-time and configuration options'
'deploy:writes deployable output files to the deploy directory'
'deploy_setscene:writes deployable output files to the deploy directory (setscene version)'
'devshell:starts a shell with the environment set up for development/debugging'
'fetch:fetches the source code'
'install:copies files from the compilation directory to a holding area'
'listtasks:lists all defined tasks for a target'
'package:analyzes the content of the holding area and splits it into subsets based on available packages and files'
'package_qa:runs qa checks on packaged files'
'package_qa_setscene:runs qa checks on packaged files (setscene version)'
'package_setscene:analyzes the content of the holding area and splits it into subsets based on available packages and files (setscene version)'
'package_write_rpm:creates the actual rpm packages and places them in the package feed area'
'package_write_rpm_setscene:creates the actual rpm packages and places them in the package feed area (setscene version)'
'package_write_deb:creates the actual deb packages and places them in the package feed area'
'package_write_deb_setscene:creates the actual deb packages and places them in the package feed area (setscene version)'
'package_write_ipk:creates the actual ipk packages and places them in the package feed area'
'package_write_ipk_setscene:creates the actual ipk packages and places them in the package feed area (setscene version)'
'packagedata:creates package metadata used by the build system to generate the final packages'
'packagedata_setscene:creates package metadata used by the build system to generate the final packages (setscene version)'
'patch:locates patch files and applies them to the source code'
'populate_lic:writes license information for the recipe that is collected later when the image is constructed'
'populate_lic_setscene:writes license information for the recipe that is collected later when the image is constructed (setscene version)'
'populate_sysroot:copies a subset of files installed by do_install into the sysroot in order to make them available to other recipes'
'populate_sysroot_setscene:copies a subset of files installed by do_install into the sysroot in order to make them available to other recipes (setscene version)'
'populate_sdk:creates the file and directory structure for an SDK'
'populate_sdk_ext:creates the file and directory structure for an extensible SDK'
'prepare_recipe_sysroot:prepare the recipe'\''s sysroot'
'pydevshell:starts an interactive python shell for development/debugging'
'unpack:unpacks the source code into a working directory'
)
# The array `line` stores the normal arguments from the command line.
# Add kernel-specific tasks to the completion when matching kernel_regexp.
# Add kbuild tasks to the completion when matching kbuild_regexp.
local kernel_sub="linux-.*"
local kernel_regexp="^${kernel_sub}|^virtual/kernel$"
local kbuild_regexp="^${kernel_sub}|^busybox$|^u-boot-.*|^barebox$|^virtual/kernel$|^virtual/bootloader$"
if [[ ${#line[@]} == 1 ]] && [[ $line =~ $kbuild_regexp ]]; then
_bb_tasks+=(
'menuconfig:runs '\''make menuconfig'\'
'diffconfig:compares the old and new config files after running do_menuconfig'
'savedefconfig:creates a minimal configuration file'
)
fi
if [[ ${#line[@]} == 1 ]] && [[ $line =~ $kernel_regexp ]]; then
_bb_tasks+=(
'compile_kernelmodules:compile loadable modules for the linux kernel'
)
fi
_describe -t _bb_tasks "Common bitbake tasks" _bb_tasks
}
__recipes()
{
local -a _recipes
local virtual_recipes=(
virtual/bootloader
virtual/crypt
virtual/dtb
virtual/gettext
virtual/kernel
virtual/libc
virtual/libgl
virtual/libiconv
virtual/libintl
virtual/librpc
virtual/libsdl2
virtual/libx11
virtual/make
virtual/mesa
virtual/perf
virtual/update-alternatives
virtual/x-terminal-emulator
virtual/xserver
)
if [ -n "$ZSH_BITBAKE_DISABLE_RECIPE_COMPLETION" ]; then
return 0
fi
if [ ! -d "$BUILDDIR" ]; then
return 0
fi
if ! command -v bitbake-layers sed tail >/dev/null; then
return 0
fi
local recipe_cache_path="$BUILDDIR/.recipe-cache"
if [ ! -f "$recipe_cache_path" ]; then
bitbake-layers show-recipes --color=never -rb \
| sed -ne '/=== Available recipes: ===/,//p' \
| tail -n +2 \
>"$recipe_cache_path"
else
while IFS='' read -r recipe || [ -n "${recipe}" ]; do
_recipes+=( "$recipe" )
done < "$recipe_cache_path"
fi
# Add the common virtual/* providers.
_recipes+=( ${virtual_recipes[*]} )
_describe -t _recipes "Recipes in current environment" _recipes
}
# Recipes local to devtool workspace.
__recipes_workspace()
{
local -a _recipes
if [ -n "$ZSH_BITBAKE_DISABLE_RECIPE_COMPLETION" ]; then
return 0
fi
if [ ! -d "$BUILDDIR/" ]; then
return 0
fi
if ! command -v find >/dev/null; then
return 0
fi
_recipes+=(
$(find "$BUILDDIR"/workspace/sources \
-maxdepth 1 \
-mindepth 1 \
-exec basename "{}" \;)
)
_describe -t _recipes "Recipes in current workspace" _recipes
}
__debug_domains() {
local -a _debug_domains
_debug_domains=(
'Build'
'Cache'
'CodeParser'
'Collection'
'Data'
'Event'
'Fetcher'
'layerindexlib'
'layerindexlib.cooker'
'layerindexlib.plugin'
'layerindexlib.restapi'
'Main'
'Monitor'
'OE.Terminal'
'Parsing'
'PersistData'
'Process'
'Provider'
'PRserv'
'RunQueue'
'RunQueue.HashEquiv'
'SigGen'
'SigGen.HashEquiv'
'TaskData'
'TestCodeParser'
'TestParse'
'TestSiggen'
'Util'
'Warnings'
)
_describe -t _debug_domains "Common bitbake debug domains" _debug_domains
}
_bitbake()
{
integer ret=1
local -a args
# We might be completing another command like devtool.
if [[ $service != bitbake ]]; then
_$service
return
fi
args=(
'(: * -)'{-h,--help}'[display help information]'
'(: * -)'--version'[display version information]'
'(-s,--show-versions)'{-s,--show-versions}'[show current and preferred versions of all recipes]'
'(-g,--graphviz)'{-g,--graphviz}'[save dependency tree information for the specified targets]'
'(-e,--environment)'{-e,--environment}'[show the global or per-recipe environment]'
'(-u,--ui)'{-u+,--ui=}'[user interface to use]: :(knotty ncurses teamcity)'
'(-f,--force)'{-f,--force}'[force the specified targets/task to run]'
'(-c,--cmd)'{-c+,--cmd=}'[specify the task to execute]: :__bb_tasks'
'(-C,--clear-stamp)'{-C+,--clear-stamp=}'[invalidate task stamp and build specified target(s)]: :__bb_tasks'
'(--runall --runonly)'--runall='[run the specified task for any recipe in the taskgraph of target]: :__bb_tasks'
'(--runonly --runall)'--runonly='[run only the specified task within the taskgraph of target]: :__bb_tasks'
'(--no-setscene --skip-setscene --setscene-only)'--no-setscene'[don'\''t run any setscene tasks]'
'(--skip-setscene --no-setscene --setscene-only)'--skip-setscene'[skip setscene tasks if they would be executed]'
'(--setscene-only --skip-setscene --no-setscene)'--setscene-only'[only run setscene tasks]'
'(-n,--dry-run)'{-n,--dry-run}'[don'\''t execute, just go through the motions]'
'(-p,--parse-only)'{-p,--parse-only}'[quit after parsing the BB recipes]'
'(-k,--continue)'{-k,--continue}'[continue as much as possible after an error]'
'(-P,--profile)'{-P,--profile}'[profile the command and save reports]'
'(-S,--dump-signatures)'{-S+,--dump-signatures=}'[dump out the signature construction information]: :(none printdiff)'
'(--revisions-changed)'--revisions-changed'[set the exit code depending on upstream revisions changes]'
'(: *)'{-b+,--buildfile=}'[execute tasks from a specific .bb recipe]: :_files'
'*'{-D,--debug}'[increase the debug level]'
'(-l,--log-domains)'{-l+,--log-domains=}'[show debug logging for specified logging domains]: :__debug_domains'
'(-v,--verbose)'{-v,--verbose}'[enable tracing of shell tasks and print bb.note]'
'(-q,--quiet)'{-q,--quiet}'[output less log message data to the terminal]'
'(-w,--write-log)'{-w+,--write-log=}'[write the event log to a bitbake event json file]: :_files'
'(-B,--bind)'{-B+,--bind=}'[name/address for the bitbake xmlrpc server to bind to]: :'
'(-T,--idle-timeout)'{-T+,--idle-timeout=}'[timeout to unload bitbake server due to inactivity]: :'
'(--remote-server)'--remote-server='[connect to the specified server]: :'
'(-m,--kill-server)'{-m,--kill-server}'[terminate any running bitbake server]'
'(--token)'--token='[token to be used when connecting to a remote server]:xmlrpctoken:'
'(--observe-only)'--observe-only'[connect to a server as an observing-only client]'
'(--status-only)'--status-only'[check the status of the remote bitbake server]'
'(--server-only)'--server-only'[run bitbake without a ui]'
'(-r,--read)'{-r+,--read=}'[read the specified file before bitbake.conf]: :_files'
'(-R,--postread)'{-R+,--postread=}'[read the specified file after bitbake.conf]: :_files'
'(-I,--ignore-deps)'{-I+,--ignore-deps=}'[assume these dependencies are already provided]: :'
'*: :__recipes'
)
# test-complete logic
[[ $_COMPLETE_LIST_ARGS == 1 ]] && {
print -rl - $args
return 0
}
_arguments $(__arguments_opts) $args && ret=0
return ret
}
#
# devtool
#
__devtool_subcommand ()
{
integer ret=1
local -a args
# test-complete logic
if [[ $_COMPLETE_LIST_SUBCOMMAND == 1 ]]; then
# Override words to artificially fill it with the subcommand from
# test-complete.
local -a words=( $_COMPLETE_SUBCOMMAND )
fi
case "$words[1]" in
(add)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-s --same-dir)'{-s,--same-dir}'[build in same directory as source]'
'(--no-same-dir)'--no-same-dir'[force build in a separate build directory]'
'(--npm-dev)'--npm-dev'[for npm also fetch devDependencies]'
'(-V --version)'{-V+,--version=}'[version to use within recipe (PV)]'
'(-g --no-git)'{-g,--no-git}'[if fetching source don'\''t set up source tree as a git repo]'
'(-S --srcrev)'{-S+,--srcrev=}'[source revision to fetch if fetching from an SCM]'
'(-a --autorev)'{-a,--autorev}'[if fetching from a git repo set SRCREV in to AUTOREV]'
'(-B --srcbranch)'{-B+,--srcbranch=}'[branch in source repo if fetching from an SCM]'
'(-b --binary)'{-b,--binary}'[treat the source tree as something that should be installed verbatim]'
'(--also-native)'--also-native'[also add native variant]'
'(--src-subdir)'--src-subdir='[specify subdirectory within source tree to use]'
'(--mirrors)'--mirrors'[enable PREMIRRORS and MIRRORS for source tree fetching]'
'(-p --provides)'{-p+,--provides=}'[specify an alias for the item provided by recipe]'
'(-f --fetch)'{-f+,--fetch=}'[(deprecated) fetch the specified URI and extract to create source tree]'
'(--no-pypi)'--no-pypi'[do not inherit pypi class]'
':recipename:'
':srctree:_directories'
':fetchuri:'
)
;;
(build-image)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-p --add-packages)'{-p+,--add-packages=}'[specify comma-separated packages to be added to the image]'
': :__recipes'
)
;;
(build)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-s --disable-parallel-make)'{-s,--disable-parallel-make}'[disable make parallelism]'
'(-c --clean)'{-c,--clean}'[clean up recipe building results]'
': :__recipes_workspace'
)
;;
(check-upgrade-status)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-a --all)'{-a,--all}'[show all recipes, not just recipes needing upgrade]'
'*: :__recipes'
)
;;
(configure-help)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-p --no-pager)'{-p,--no-pager}'[disable paged output]'
'(-n --no-header)'{-n,--no-header}'[disable explanatory header text]'
'(: - *)'--arg'[pass remaining arguments to configure script instead of --help]'
': :__recipes_workspace'
)
;;
(create-workspace)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(--create-only)'--create-only'[only create the workspace layer don'\''t alter configuration]'
'(--layerseries)'--layerseries='[layer series the workspace should be set to be compatible with]'
': :_directories' # layerpath
)
;;
(deploy-target)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-c --no-host-check)'{-c,--no-host-check}'[disable ssh host key checking]'
'(-s --show-status)'{-s,--show-status}'[show progress/status output]'
'(-n --dry-run)'{-n,--dry-run}'[list files to be deployed only]'
'(-p --no-preserve)'{-p,--no-preserve}'[don'\''t preserve existing files]'
'(--no-check-space)'--no-check-space'[don'\''t check for available space before deploying]'
'(-e --ssh-exec)'{-e+,--ssh-exec=}'[executable to use in place of ssh]'
'(-P --port)'{-P+,--port=}'[port to use for connection to the target]'
'(-I --key)'{-I+,--key=}'[ssh private key for connection to the target]'
'(-S --strip --no-strip)'{-S,--strip}'[strip executables prior to deploying]'
'(--no-strip -S --strip)'--no-strip'[don'\''t strip executables prior to deploy]'
': :__recipes_workspace'
': :_hosts' # target
)
;;
(edit-recipe)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-a --any-recipe)'{-a,--any-recipe}'[does nothing (exists for backwards-compatibility)]'
': :__recipes'
)
;;
(export)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-f --file)'{-f+,--file=}'[output archive file name]: :_files'
'(-o --overwrite)'{-o,--overwrite}'[overwrite previous export tar archive]'
'*'{-i+,--include=}'[include recipes into the tar archive]: :__recipes'
'*'{-e+,--exclude=}'[exclude recipes into the tar archive]: :__recipes'
)
;;
(extract)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-b --branch)'{-b+,--branch=}'[name for development branch to checkout]'
'(-O --no-overrides)'{-O,--no-overrides}'[don'\''t create branches for other override configurations]'
'(--keep-temp)'--keep-temp'[keep temporary directory]'
': :__recipes'
': :_directories' # srctree
)
;;
(find-recipe)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-a --any-recipe)'{-a,--any-recipe}'[does nothing (exists for backwards-compatibility)]'
': :__recipes'
)
;;
(finish)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-m --mode)'{-m+,--mode=}'[update mode (patch, src or auto)]: :(patch srcrev auto)'
'(--initial-rev)'--initial-rev='[override starting revision for patches]'
'(-f --force)'{-f,--force}'[force continuing even if there are uncommitted changes in the source tree repo]'
'(-r --remove-work)'{-r,--remove-work}'[clean the sources directory under workspace]'
'(-n --no-clean)'{-n,--no-clean}'[don'\''t clean the sysroot to remove recipe output]'
'(-O --no-overrides)'{-O,--no-overrides}'[don'\''t handle other override branches if they exist]'
'(-N --dry-run)'{-N,--dry-run}'[just report changes instead of writing them]'
'(--force-patch-refresh)'--force-patch-refresh'[update patches in layer even if they haven'\''t been modified]'
': :__recipes_workspace'
': :_directories' # destination
)
;;
(ide-sdk)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-m --mode)'{-m+,--mode=}'[SDK type]: :(modified shared)'
'(-i --ide)'{-i+,--ide=}'[IDE to setup configuration for]: :(none code)'
'(-t --target)'{-t+,--target=}'[live target machine running an ssh server (user@hostname)]'
'(-G --gdbserver-port-start)'{-G+,--gdbserver-port-start=}'[port where gdbserver is listening]'
'(-c --no-host-check)'{-c,--no-host-check}'[disable ssh host key checking]'
'(-e --ssh-exec)'{-e+,--ssh-exec=}'[executable to use in place of ssh]'
'(-P --port)'{-P+,--port=}'[specify ssh port to use for connection to the target]'
'(-I --key)'{-I+,--key=}'[specify ssh private key for connection to the target]'
'(--skip-bitbake)'--skip-bitbake'[skip calling bitbake to update the SDK]'
'(-k --bitbake-k)'{-k,--bitbake-k}'[pass -k parameter to bitbake]'
'(--no-strip)'--no-strip'[do not strip executables prior to deploy]'
'(-n --dry-run)'{-n,--dry-run}'[list files to be undeployed only]'
'(-s --show-status)'{-s,--show-status}'[show progress/status output]'
'(-p --no-preserve)'{-p,--no-preserve}'[do not preserve existing files]'
'(--no-check-space)'--no-check-space'[do not check for available space before deploying]'
'(--debug-build-config)'--debug-build-config'[use debug build flags, for example set CMAKE_BUILD_TYPE=Debug]'
': :__recipes_workspace'
)
;;
(import)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-o --overwrite)'{-o,--overwrite}'[overwrite files when extracting]'
': :_files'
)
;;
(latest-version)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
': :__recipes'
)
;;
(menuconfig)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
': :__recipes_workspace'
)
;;
(modify)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-w --wildcard)'{-w,--wildcard}'[use wildcard for unversioned bbappend]'
'(-x --extract)'{-x,--extract}'[extract source for recipe (default)]'
'(-n --no-extract)'{-n,--no-extract}'[don'\''t extract source, expect it to exist]'
'(-s --same-dir)'{-s,--same-dir}'[build in same directory as source]'
'(--no-same-dir)'--no-same-dir'[force build in a separate build directory]'
'(-b --branch)'{-b+,--branch=}'[name for development branch to checkout]'
'(-O --no-overrides)'{-O,--no-overrides}'[don'\''t create branches for other override configurations]'
'(--keep-temp)'--keep-temp'[keep temporary directory (for debugging)]'
': :__recipes'
': :_directories' # srctree
)
;;
(rename)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-V --version)'{-V+,--version=}'[change the version (version in the recipe file name)]'
'(-s --no-srctree)'{-s,--no-srctree}'[don'\''t rename the source tree directory]'
': :__recipes_workspace'
':newname:'
)
;;
(reset)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-a --all)'{-a,--all}'[reset all recipes (clear workspace)]'
'(-n --no-clean)'{-n,--no-clean}'[don'\''t clean the sysroot to remove recipe output]'
'(-r --remove-work)'{-r,--remove-work}'[clean the sources directory along with append]'
'*: :__recipes_workspace'
)
;;
(search)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
':keyword:'
)
;;
(status)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
)
;;
(sync)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-b --branch)'{-b+,--branch=}'[name for development branch to checkout]'
'(--keep-temp)'--keep-temp'[keep temporary directory for debugging]'
': :__recipes'
': :_directories' # srctree
)
;;
(undeploy-target)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-c --no-host-check)'{-c,--no-host-check}'[disable ssh host key checking]'
'(-s --show-status)'{-s,--show-status}'[show progress/status output]'
'(-a --all)'{-a,--all}'[undeploy all recipes deployed on the target]'
'(-n --dry-run)'{-n,--dry-run}'[list files to be undeployed only]'
'(-e --ssh-exec)'{-e+,--ssh-exec=}'[executable to use in place of ssh]'
'(-P --port)'{-P+,--port=}'[port to use for connection to the target]'
'(-I --key)'{-I+,--key=}'[ssh private key for connection to the target]'
': :__recipes_workspace'
': :_hosts' # target
)
;;
(update-recipe)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-m --mode)'{-m+,--mode=}'[update mode (patch, src or auto)]: :(patch srcrev auto)'
'(--initial-rev)'--initial-rev='[override starting revision for patches]'
'(-a --append)'{-a+,--append=}'[write changes to a bbappend in the specified layer instead]'
'(-w --wildcard-version)'{-w,--wildcard-version}'[in conjunction with -a use a wildcard to apply to any recipe version]'
'(-n --no-remove)'{-n,--no-remove}'[don'\''t remove patches, only add or update]'
'(-O --no-overrides)'{-O,--no-overrides}'[don'\''t handle other override branches]'
'(-N --dry-run)'{-N,--dry-run}'[just report changes instead of writing them]'
'(--force-patch-refresh)'--force-patch-refresh'[update patches in the layer even if unmodified]'
': :__recipes_workspace'
)
;;
(upgrade)
args+=(
'(-h --help)'{-h,--help}'[print usage]'
'(-V --version)'{-V+,--version=}'[version to upgrade to (PV)]'
'(-S --srcrev)'{-S+,--srcrev=}'[source revision to upgrade to if using an SCM]'
'(-B --srcbranch)'{-B+,--srcbranch=}'[branch in source repo containing the revision to use]'
'(-b --branch)'{-b+,--branch=}'[name for new development branch to checkout]'
'(--no-patch)'--no-patch'[don'\''t apply patches from the recipe to the new source code]'
'(-O --no-overrides)'{-O,--no-overrides}'[don'\''t create branches for other override configurations]'
'(-s --same-dir)'{-s,--same-dir}'[build in same directory as source]'
'(--no-same-dir)'--no-same-dir'[force build in a separate build directory]'
'(--keep-temp)'--keep-temp'[keep temporary directory (for debugging)]'
'(--keep-failure)'--keep-failure'[keep failed upgrade recipe and associated files (for debugging)]'
': :__recipes'
': :_directories' # srctree
)
;;
esac
# test-complete logic
if [[ $_COMPLETE_LIST_SUBCOMMAND == 1 ]]; then
print -rl - $args
return 0
fi
_arguments $(__arguments_opts) $args && ret=0
return ret
}
__devtool_commands ()
{
local -a _devtool_commands
_devtool_commands=(
'add:add a new recipe'
'build-image:build image including workspace recipe packages'
'build:build a recipe'
'check-upgrade-status:report upgradability for multiple (or all) recipes'
'configure-help:get help on configure script options'
'create-workspace:set up workspace in an alternative location'
'deploy-target:deploy recipe output files to live target machine'
'edit-recipe:edit a recipe file'
'export:export workspace into a tar archive'
'extract:extract the source for an existing recipe'
'find-recipe:find a recipe file'
'finish:finish working on a recipe in your workspace'
'ide-sdk:setup the SDK and configure the IDE'
'import:import exported tar archive into workspace'
'latest-version:report the latest version of an existing recipe'
'menuconfig:alter build-time configuration for a recipe'
'modify:modify the source for an existing recipe'
'rename:rename a recipe file in the workspace'
'reset:remove a recipe from your workspace'
'search:search available recipes'
'status:show workspace status'
'sync:synchronize the source tree for an existing recipe'
'undeploy-target:undeploy recipe output files in live target machine'
'update-recipe:apply changes from external source tree to recipe'
'upgrade:upgrade an existing recipe'
)
# test-complete logic
if [[ $_COMPLETE_LIST_SUBCOMMANDS == 1 ]]; then
print -rl - $_devtool_commands
return 0
fi
_describe -t _devtool_commands "devtool commands" _devtool_commands
}
_devtool()
{
integer ret=1
local -a args
# Global arguments, not command specific.
args=(
'(: * -)'{-h,--help}'[display help information]'
'(--basepath)'--basepath='[base directory of sdk or build directory]: :_directories'
'(--bbpath)'--bbpath='[explicitly specify the BBPATH]:bbpath:'
'(-d,--debug -q --quiet)'{-d,--debug}'[enable debug output]'
'(-q,--quiet -d,--debug)'{-q,--quiet}'[print only errors]'
'(--color)'--color='[colorize output]: :(auto always never)'
'(-): :->command'
'(-)*:: :->option-or-argument'
)
# test-complete logic
if [[ $_COMPLETE_LIST_SUBCOMMANDS == 1 ]]; then
state="command"
elif [[ $_COMPLETE_LIST_SUBCOMMAND == 1 ]]; then
state="option-or-argument"
elif [[ $_COMPLETE_LIST_ARGS == 1 ]]; then
print -rl - $args
return 0
else
_arguments $(__arguments_opts) $args && ret=0
fi
case $state in
(command)
# Completion for devtool's commands (add, modify, …).
__devtool_commands && ret=0
;;
(option-or-argument)
# Completion for devtool commands's options.
__devtool_subcommand && ret=0
;;
esac
return ret
}
_bitbake "$@"