summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-01-27 17:59:25 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-30 15:14:58 +0000
commitc58c94824b29665f52ae67ceae3f096930c89fe5 (patch)
tree56b36f521404879976306f086dab08794b89b9a8
parent635130d0d1234c503aa8b7ea10473f63afd36ad5 (diff)
downloadpoky-c58c94824b29665f52ae67ceae3f096930c89fe5.tar.gz
bitbake: toaster: update texts for the startup sequence
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] (Bitbake rev: 90ef8975f35e2da824bc1c80e41ca26d9af0b208) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xbitbake/bin/toaster6
-rw-r--r--bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py21
-rw-r--r--bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py2
3 files changed, 18 insertions, 11 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index a6d2e92d17..4f25293e73 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -68,7 +68,7 @@ function webserverStartAll()
68 python $BBBASEDIR/lib/toaster/manage.py checksettings --traceback || retval=1 68 python $BBBASEDIR/lib/toaster/manage.py checksettings --traceback || retval=1
69 fi 69 fi
70 if [ $retval -eq 0 ]; then 70 if [ $retval -eq 0 ]; then
71 echo "Starting webserver" 71 echo "Starting webserver..."
72 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 72 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
73 sleep 1 73 sleep 1
74 if ! cat "${BUILDDIR}/.toastermain.pid" | xargs -I{} kill -0 {} ; then 74 if ! cat "${BUILDDIR}/.toastermain.pid" | xargs -I{} kill -0 {} ; then
@@ -171,7 +171,7 @@ if [ -z "$ZSH_NAME" ] && [ `basename \"$0\"` = `basename \"$BASH_SOURCE\"` ]; th
171 # Start just the web server, point the web browser to the interface, and start any Django services. 171 # Start just the web server, point the web browser to the interface, and start any Django services.
172 172
173 if [ -n "$BUILDDIR" ]; then 173 if [ -n "$BUILDDIR" ]; then
174 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; 174 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;
175 exit 1; 175 exit 1;
176 fi 176 fi
177 177
@@ -194,7 +194,7 @@ if [ -z "$ZSH_NAME" ] && [ `basename \"$0\"` = `basename \"$BASH_SOURCE\"` ]; th
194 xdg-open http://127.0.0.1:$WEB_PORT/ >/dev/null 2>&1 & 194 xdg-open http://127.0.0.1:$WEB_PORT/ >/dev/null 2>&1 &
195 fi 195 fi
196 trap trap_ctrlc SIGINT 196 trap trap_ctrlc SIGINT
197 echo "Running. Stop with Ctrl-C" 197 echo "Toaster is now running. You can stop it with Ctrl-C"
198 while [ $RUNNING -gt 0 ]; do 198 while [ $RUNNING -gt 0 ]; do
199 python $BBBASEDIR/lib/toaster/manage.py runbuilds 199 python $BBBASEDIR/lib/toaster/manage.py runbuilds
200 sleep 1 200 sleep 1
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
index 55f118cf77..cf3c3d7ecf 100644
--- a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
+++ b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
@@ -80,27 +80,33 @@ class Command(NoArgsCommand):
80 for be in BuildEnvironment.objects.all(): 80 for be in BuildEnvironment.objects.all():
81 def _verify_be(): 81 def _verify_be():
82 is_changed = False 82 is_changed = False
83 print("Verifying the Build Environment type %s id %d." % (be.get_betype_display(), be.pk)) 83 print("Verifying the Build Environment. If the Build Environment is completly configured, you will be asked to configure it.")
84 if len(be.sourcedir) == 0: 84 if len(be.sourcedir) == 0:
85 suggesteddir = self._get_suggested_sourcedir(be) 85 suggesteddir = self._get_suggested_sourcedir(be)
86 be.sourcedir = raw_input(" -- Layer sources checkout directory may not be empty [guessed \"%s\"]:" % suggesteddir) 86 if len(suggesteddir) > 0:
87 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))
88 else:
89 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'])
87 if len(be.sourcedir) == 0 and len(suggesteddir) > 0: 90 if len(be.sourcedir) == 0 and len(suggesteddir) > 0:
88 be.sourcedir = suggesteddir 91 be.sourcedir = suggesteddir
89 is_changed = True 92 is_changed = True
90 93
91 if not be.sourcedir.startswith("/"): 94 if not be.sourcedir.startswith("/"):
92 be.sourcedir = raw_input(" -- Layer sources checkout directory must be an absolute path:") 95 be.sourcedir = raw_input(" Layer sources checkout directory must be an absolute path:")
93 is_changed = True 96 is_changed = True
94 97
95 if len(be.builddir) == 0: 98 if len(be.builddir) == 0:
96 suggesteddir = self._get_suggested_builddir(be) 99 suggesteddir = self._get_suggested_builddir(be)
97 be.builddir = raw_input(" -- Build directory may not be empty [guessed \"%s\"]:" % suggesteddir) 100 if len(suggesteddir) > 0:
101 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))
102 else:
103 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'])
98 if len(be.builddir) == 0 and len(suggesteddir) > 0: 104 if len(be.builddir) == 0 and len(suggesteddir) > 0:
99 be.builddir = suggesteddir 105 be.builddir = suggesteddir
100 is_changed = True 106 is_changed = True
101 107
102 if not be.builddir.startswith("/"): 108 if not be.builddir.startswith("/"):
103 be.builddir = raw_input(" -- Build directory must be an absolute path:") 109 be.builddir = raw_input(" Build directory must be an absolute path:")
104 is_changed = True 110 is_changed = True
105 111
106 112
@@ -109,6 +115,7 @@ class Command(NoArgsCommand):
109 be.save() 115 be.save()
110 116
111 if is_changed and be.betype == BuildEnvironment.TYPE_LOCAL: 117 if is_changed and be.betype == BuildEnvironment.TYPE_LOCAL:
118 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."
112 for dirname in self._recursive_list_directories(be.sourcedir,2): 119 for dirname in self._recursive_list_directories(be.sourcedir,2):
113 if os.path.exists(os.path.join(dirname, ".templateconf")): 120 if os.path.exists(os.path.join(dirname, ".templateconf")):
114 import subprocess 121 import subprocess
@@ -116,13 +123,13 @@ class Command(NoArgsCommand):
116 conffilepath = os.path.join(conffilepath.strip(), "toasterconf.json") 123 conffilepath = os.path.join(conffilepath.strip(), "toasterconf.json")
117 candidatefilepath = os.path.join(dirname, conffilepath) 124 candidatefilepath = os.path.join(dirname, conffilepath)
118 if os.path.exists(candidatefilepath): 125 if os.path.exists(candidatefilepath):
119 i = raw_input(" -- Do you want to import basic layer configuration from \"%s\" ? (y/N):" % candidatefilepath) 126 i = raw_input("\n Found an preset configuration file \"%s\".\n Do you want to use it? (y/N):" % candidatefilepath)
120 if len(i) and i.upper()[0] == 'Y': 127 if len(i) and i.upper()[0] == 'Y':
121 from loadconf import Command as LoadConfigCommand 128 from loadconf import Command as LoadConfigCommand
122 129
123 LoadConfigCommand()._import_layer_config(candidatefilepath) 130 LoadConfigCommand()._import_layer_config(candidatefilepath)
124 # we run lsupdates after config update 131 # we run lsupdates after config update
125 print "Layer configuration imported. Updating information from the layer source, please wait." 132 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"
126 from django.core.management import call_command 133 from django.core.management import call_command
127 call_command("lsupdates") 134 call_command("lsupdates")
128 135
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
index 2257a7143b..e2f61e4cb4 100644
--- a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
+++ b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
@@ -22,7 +22,7 @@ def _get_id_for_sourcetype(s):
22 for i in LayerSource.SOURCE_TYPE: 22 for i in LayerSource.SOURCE_TYPE:
23 if s == i[1]: 23 if s == i[1]:
24 return i[0] 24 return i[0]
25 raise Exception("Could not find definition for sourcetype " + s) 25 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 ))))
26 26
27class Command(BaseCommand): 27class Command(BaseCommand):
28 help = "Loads a toasterconf.json file in the database" 28 help = "Loads a toasterconf.json file in the database"