diff options
author | Reyna, David <david.reyna@windriver.com> | 2020-03-27 15:51:00 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-29 20:02:36 +0100 |
commit | 063e0ced9aab18c25a0438207c89b0259b0aaeb8 (patch) | |
tree | 801d84a2e747401fa62a3417adddaf13f0031235 | |
parent | 3dc19bb3be5c1ebf3dc70d77ebbb74b24e28dace (diff) | |
download | poky-063e0ced9aab18c25a0438207c89b0259b0aaeb8.tar.gz |
bitbake: toaster: support environment-safe manage commands
Directly support the various 'manage' commands from the Toaster
executable, so that users do not have to manually set up the required
environment and paths.
Examples:
$ . toaster manage createsuperuser
$ . toaster manage lsupdates
[YOCTO #13170]
(Bitbake rev: fd844e55bb885a51fe5ef8da1f625b34e646cf5f)
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | bitbake/bin/toaster | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster index c3472dfee8..6b90ee187e 100755 --- a/bitbake/bin/toaster +++ b/bitbake/bin/toaster | |||
@@ -8,12 +8,13 @@ | |||
8 | # | 8 | # |
9 | 9 | ||
10 | HELP=" | 10 | HELP=" |
11 | Usage: source toaster start|stop [webport=<address:port>] [noweb] [nobuild] [toasterdir] | 11 | Usage 1: source toaster start|stop [webport=<address:port>] [noweb] [nobuild] [toasterdir] |
12 | Optional arguments: | 12 | Optional arguments: |
13 | [nobuild] Setup the environment for capturing builds with toaster but disable managed builds | 13 | [nobuild] Setup the environment for capturing builds with toaster but disable managed builds |
14 | [noweb] Setup the environment for capturing builds with toaster but don't start the web server | 14 | [noweb] Setup the environment for capturing builds with toaster but don't start the web server |
15 | [webport] Set the development server (default: localhost:8000) | 15 | [webport] Set the development server (default: localhost:8000) |
16 | [toasterdir] Set absolute path to be used as TOASTER_DIR (default: BUILDDIR/../) | 16 | [toasterdir] Set absolute path to be used as TOASTER_DIR (default: BUILDDIR/../) |
17 | Usage 2: source toaster manage [createsuperuser|lsupdates|migrate|makemigrations|checksettings|collectstatic|...] | ||
17 | " | 18 | " |
18 | 19 | ||
19 | custom_extention() | 20 | custom_extention() |
@@ -208,13 +209,21 @@ for param in $*; do | |||
208 | toasterdir=*) | 209 | toasterdir=*) |
209 | TOASTERDIR="${param#*=}" | 210 | TOASTERDIR="${param#*=}" |
210 | ;; | 211 | ;; |
212 | manage ) | ||
213 | CMD=$param | ||
214 | manage_cmd="" | ||
215 | ;; | ||
211 | --help) | 216 | --help) |
212 | echo "$HELP" | 217 | echo "$HELP" |
213 | return 0 | 218 | return 0 |
214 | ;; | 219 | ;; |
215 | *) | 220 | *) |
216 | echo "$HELP" | 221 | if [ "manage" == "$CMD" ] ; then |
217 | return 1 | 222 | manage_cmd="$manage_cmd $param" |
223 | else | ||
224 | echo "$HELP" | ||
225 | exit 1 | ||
226 | fi | ||
218 | ;; | 227 | ;; |
219 | 228 | ||
220 | esac | 229 | esac |
@@ -306,6 +315,10 @@ case $CMD in | |||
306 | stop_system | 315 | stop_system |
307 | echo "Successful ${CMD}." | 316 | echo "Successful ${CMD}." |
308 | ;; | 317 | ;; |
318 | manage ) | ||
319 | cd $BBBASEDIR/lib/toaster | ||
320 | $MANAGE $manage_cmd | ||
321 | ;; | ||
309 | esac | 322 | esac |
310 | custom_extention toaster_postpend $CMD $ADDR_PORT | 323 | custom_extention toaster_postpend $CMD $ADDR_PORT |
311 | 324 | ||