Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by mx.groups.io with SMTP id smtpd.web10.22503.1585341926031529442 for ; Fri, 27 Mar 2020 13:45:26 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: windriver.com, ip: 147.11.146.13, mailfrom: david.reyna@windriver.com) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.2) with ESMTPS id 02RKjPYU005841 (version=TLSv1 cipher=AES256-SHA bits=256 verify=FAIL) for ; Fri, 27 Mar 2020 13:45:25 -0700 (PDT) Received: from honig-Precision-T5600.corp.ad.wrs.com (147.11.209.184) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.3.487.0; Fri, 27 Mar 2020 13:45:24 -0700 From: "Reyna, David" To: Subject: [PATCH] toaster: support environment-safe manage commands Date: Fri, 27 Mar 2020 13:44:32 -0700 Message-ID: <20200327204432.31470-1-david.reyna@windriver.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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] Signed-off-by: David Reyna --- bitbake/bin/toaster | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster index c3472dfee8..dd4cd93581 100755 --- a/bitbake/bin/toaster +++ b/bitbake/bin/toaster @@ -8,12 +8,13 @@ # HELP=" -Usage: source toaster start|stop [webport=] [noweb] [nobuild] [toasterdir] +Usage 1: source toaster start|stop [webport=] [noweb] [nobuild] [toasterdir] Optional arguments: [nobuild] Setup the environment for capturing builds with toaster but disable managed builds [noweb] Setup the environment for capturing builds with toaster but don't start the web server [webport] Set the development server (default: localhost:8000) [toasterdir] Set absolute path to be used as TOASTER_DIR (default: BUILDDIR/../) +Usage 2: source toaster manage [createsuperuser|lsupdates|migrate|makemigrations|checksettings|collectstatic|...] " custom_extention() @@ -180,6 +181,7 @@ WEBSERVER=1 export TOASTER_BUILDSERVER=1 ADDR_PORT="localhost:8000" TOASTERDIR=`dirname $BUILDDIR` +MANAGE="python3 $OE_ROOT/bitbake/lib/toaster/manage.py" unset CMD for param in $*; do case $param in @@ -208,6 +210,9 @@ for param in $*; do toasterdir=*) TOASTERDIR="${param#*=}" ;; + manage ) + CMD=$param + ;; --help) echo "$HELP" return 0 @@ -306,6 +311,9 @@ case $CMD in stop_system echo "Successful ${CMD}." ;; + manage ) + $MANAGE $manage_cmd + ;; esac custom_extention toaster_postpend $CMD $ADDR_PORT -- 2.20.1