]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: update texts for the startup sequence
authorAlexandru DAMIAN <alexandru.damian@intel.com>
Tue, 27 Jan 2015 17:59:25 +0000 (17:59 +0000)
committerAlexandru DAMIAN <alexandru.damian@intel.com>
Fri, 30 Jan 2015 14:18:24 +0000 (14:18 +0000)
This patch updates the prompts to the user to better explain
what Toaster is doing and the information it needs from the user.

Additionally, fixes a check in loadconf command.

[YOCTO #6785]
[YOCTO #7251]

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
bin/toaster
lib/toaster/bldcontrol/management/commands/checksettings.py
lib/toaster/bldcontrol/management/commands/loadconf.py

index a6d2e92d171787f4e600c224a70376d443a534a8..4f25293e73308115206f69f86c35c2737a922146 100755 (executable)
@@ -68,7 +68,7 @@ function webserverStartAll()
                python $BBBASEDIR/lib/toaster/manage.py checksettings  --traceback || retval=1
        fi
         if [ $retval -eq 0 ]; then
-           echo "Starting webserver"
+           echo "Starting webserver..."
             python $BBBASEDIR/lib/toaster/manage.py runserver "0.0.0.0:$WEB_PORT" </dev/null >${BUILDDIR}/toaster_web_$$.log 2>&1 & echo $! >${BUILDDIR}/.toastermain.pid
             sleep 1
             if ! cat "${BUILDDIR}/.toastermain.pid" | xargs -I{} kill -0 {} ; then
@@ -171,7 +171,7 @@ if [ -z "$ZSH_NAME" ] && [ `basename \"$0\"` = `basename \"$BASH_SOURCE\"` ]; th
     # Start just the web server, point the web browser to the interface, and start any Django services.
 
     if [ -n "$BUILDDIR" ]; then
-        echo -e "Error: build/ directory detected. Toaster will not start in managed mode if a build environment is detected.\nUse a clean terminal to start Toaster." 1>&2;
+       echo -e "Error: It looks like you sourced oe-init-build-env. Toaster cannot start in build mode from an oe-core build environment. You can work around this problem by starting Toaster from a new terminal window." 1>&2;
         exit 1;
     fi
 
@@ -194,7 +194,7 @@ if [ -z "$ZSH_NAME" ] && [ `basename \"$0\"` = `basename \"$BASH_SOURCE\"` ]; th
         xdg-open http://127.0.0.1:$WEB_PORT/ >/dev/null 2>&1 &
     fi
     trap trap_ctrlc SIGINT
-    echo "Running. Stop with Ctrl-C"
+    echo "Toaster is now running. You can stop it with Ctrl-C"
     while [ $RUNNING -gt 0 ]; do
        python $BBBASEDIR/lib/toaster/manage.py runbuilds
        sleep 1
index 55f118cf770b6fcbbb150a351878f241f0aed01c..cf3c3d7ecf206d9b40d77fa0d6c72f88ec608420 100644 (file)
@@ -80,27 +80,33 @@ class Command(NoArgsCommand):
         for be in BuildEnvironment.objects.all():
             def _verify_be():
                 is_changed = False
-                print("Verifying the Build Environment type %s id %d." % (be.get_betype_display(), be.pk))
+                print("Verifying the Build Environment. If the Build Environment is completly configured, you will be asked to configure it.")
                 if len(be.sourcedir) == 0:
                     suggesteddir = self._get_suggested_sourcedir(be)
-                    be.sourcedir = raw_input(" -- Layer sources checkout directory may not be empty [guessed \"%s\"]:" % suggesteddir)
+                    if len(suggesteddir) > 0:
+                        be.sourcedir = raw_input("\nToaster needs to know in which directory it should check out the layers that will be needed for your builds.\n Toaster suggests \"%s\". If you select this directory, a layer like \"meta-yocto\" will end up in \"%s/meta-yocto\".\n Press Enter to select \"%s\" or type the full path to a different directory: " % (suggesteddir, suggesteddir, suggesteddir))
+                    else:
+                        be.sourcedir = raw_input("\nToaster needs to know in which directory it should check out the layers that will be needed for your builds. Type the full path to the directory (for example: \"%s\": " % os.environment['HOME'])
                     if len(be.sourcedir) == 0 and len(suggesteddir) > 0:
                         be.sourcedir = suggesteddir
                     is_changed = True
 
                 if not be.sourcedir.startswith("/"):
-                    be.sourcedir = raw_input(" -- Layer sources checkout directory must be an absolute path:")
+                    be.sourcedir = raw_input(" Layer sources checkout directory must be an absolute path:")
                     is_changed = True
 
                 if len(be.builddir) == 0:
                     suggesteddir = self._get_suggested_builddir(be)
-                    be.builddir = raw_input(" -- Build directory may not be empty [guessed \"%s\"]:" % suggesteddir)
+                    if len(suggesteddir) > 0:
+                        be.builddir = raw_input("\nToaster needs to know where is your build directory.\n The build directory is where all the artifacts created by your builds will be stored. Toaster suggests \"%s\".\n Press Enter to select \"%s\" or type the full path to a different directory: " % (suggesteddir, suggesteddir))
+                    else:
+                        be.builddir = raw_input("\nToaster needs to know where is your build directory.\n The build directory is where all the artifacts created by your builds will be stored. Type the full path to the directory (for example: \" %s/build\")" % os.environment['HOME'])
                     if len(be.builddir) == 0 and len(suggesteddir) > 0:
                         be.builddir = suggesteddir
                     is_changed = True
 
                 if not be.builddir.startswith("/"):
-                    be.builddir = raw_input(" -- Build directory must be an absolute path:")
+                    be.builddir = raw_input(" Build directory must be an absolute path:")
                     is_changed = True
 
 
@@ -109,6 +115,7 @@ class Command(NoArgsCommand):
                     be.save()
 
                 if is_changed and be.betype == BuildEnvironment.TYPE_LOCAL:
+                    print "\nToaster can use a SINGLE predefined configuration file to set up default project settings and layer information sources.\n Toaster will list now the configuration files that it found. Select Yes to use the desired configuration file."
                     for dirname in self._recursive_list_directories(be.sourcedir,2):
                         if os.path.exists(os.path.join(dirname, ".templateconf")):
                             import subprocess
@@ -116,13 +123,13 @@ class Command(NoArgsCommand):
                             conffilepath = os.path.join(conffilepath.strip(), "toasterconf.json")
                             candidatefilepath = os.path.join(dirname, conffilepath)
                             if os.path.exists(candidatefilepath):
-                                i = raw_input(" -- Do you want to import basic layer configuration from \"%s\" ? (y/N):" % candidatefilepath)
+                                i = raw_input("\n Found an preset configuration file \"%s\".\n Do you want to use it? (y/N):" % candidatefilepath)
                                 if len(i) and i.upper()[0] == 'Y':
                                     from loadconf import Command as LoadConfigCommand
 
                                     LoadConfigCommand()._import_layer_config(candidatefilepath)
                                     # we run lsupdates after config update
-                                    print "Layer configuration imported. Updating information from the layer source, please wait."
+                                    print "Layer configuration imported. Updating information from the layer sources, please wait.\n You can re-update any time later by running bitbake/lib/toaster/manage.py lsupdates"
                                     from django.core.management import call_command
                                     call_command("lsupdates")
 
index 2257a7143bb2486a88fe2d2090ba9aba0556dab5..e2f61e4cb4714f6e9796b7fff86e035f748175ca 100644 (file)
@@ -22,7 +22,7 @@ def _get_id_for_sourcetype(s):
     for i in LayerSource.SOURCE_TYPE:
         if s == i[1]:
             return i[0]
-    raise Exception("Could not find definition for sourcetype " + s)
+    raise Exception("Could not find definition for sourcetype '%s'. Valid source types are %s" % (str(s), ', '.join(map(lambda x: "'%s'" % x[1], LayerSource.SOURCE_TYPE ))))
 
 class Command(BaseCommand):
     help = "Loads a toasterconf.json file in the database"