summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
diff options
context:
space:
mode:
authorBelen Barros Pena <belen.barros.pena@intel.com>2015-09-02 10:56:15 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-04 16:23:57 +0100
commitccc1d9ac0c7a0e1768fdfc043da106d144029f3c (patch)
treefe32fb55848733705200edaac4d54c8e4cc8a98b /bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
parent4b9de767f02d504c619582e0d62c9acd3230e76e (diff)
downloadpoky-ccc1d9ac0c7a0e1768fdfc043da106d144029f3c.tar.gz
bitbake: toaster: improve explanation of checkout dir
Improve the explanation we show to users during set up when asking them to set the layers checkout directory. The patch also makes minor changes in text formatting to improve legibility. [YOCTO #7740] (Bitbake rev: dd9284944ae0f0feecb70adab880fed636f7cd59) Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py')
-rw-r--r--bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
index 83b4f28c86..3ccc7c67c9 100644
--- a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
+++ b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
@@ -69,8 +69,8 @@ class Command(NoArgsCommand):
69 # verify that we have a settings for downloading artifacts 69 # verify that we have a settings for downloading artifacts
70 while ToasterSetting.objects.filter(name="ARTIFACTS_STORAGE_DIR").count() == 0: 70 while ToasterSetting.objects.filter(name="ARTIFACTS_STORAGE_DIR").count() == 0:
71 guessedpath = os.getcwd() + "/toaster_build_artifacts/" 71 guessedpath = os.getcwd() + "/toaster_build_artifacts/"
72 print("Toaster needs to know in which directory it can download build log files and other artifacts.\n Toaster suggests \"%s\"." % guessedpath) 72 print("\nToaster needs to know in which directory it can download build log files and other artifacts.\nToaster suggests \"%s\"." % guessedpath)
73 artifacts_storage_dir = raw_input(" Press Enter to select \"%s\" or type the full path to a different directory: " % guessedpath) 73 artifacts_storage_dir = raw_input("Press Enter to select \"%s\" or type the full path to a different directory: " % guessedpath)
74 if len(artifacts_storage_dir) == 0: 74 if len(artifacts_storage_dir) == 0:
75 artifacts_storage_dir = guessedpath 75 artifacts_storage_dir = guessedpath
76 if len(artifacts_storage_dir) > 0 and artifacts_storage_dir.startswith("/"): 76 if len(artifacts_storage_dir) > 0 and artifacts_storage_dir.startswith("/"):
@@ -104,28 +104,28 @@ class Command(NoArgsCommand):
104 be.needs_import = False 104 be.needs_import = False
105 def _verify_be(): 105 def _verify_be():
106 is_changed = False 106 is_changed = False
107 print("Verifying the Build Environment. If the local Build Environment is not properly configured, you will be asked to configure it.") 107 print("\nVerifying the build environment. If the local build environment is not properly configured, you will be asked to configure it.")
108 108
109 def _update_sourcedir(): 109 def _update_sourcedir():
110 suggesteddir = self._get_suggested_sourcedir(be) 110 suggesteddir = self._get_suggested_sourcedir(be)
111 if len(suggesteddir) > 0: 111 if len(suggesteddir) > 0:
112 be.sourcedir = raw_input("Toaster 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-intel\" will end up in \"%s/meta-intel\".\n Press Enter to select \"%s\" or type the full path to a different directory (must be a parent of current checkout directory): " % (suggesteddir, suggesteddir, suggesteddir)) 112 be.sourcedir = raw_input("This is the directory Toaster uses to check out the source code of the layers you will build. Toaster will create new clones of the layers, so existing content in the chosen directory will not be changed.\nToaster suggests you use \"%s\" as your layers checkout directory. If you select this directory, a layer like \"meta-intel\" will end up in \"%s/meta-intel\".\nPress Enter to select \"%s\" or type the full path to a different directory. If you provide your own directory, it must be a parent of the cloned directory for the sources you are using to run Toaster: " % (suggesteddir, suggesteddir, suggesteddir))
113 else: 113 else:
114 be.sourcedir = raw_input("Toaster 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.environ.get('HOME', '/tmp/')) 114 be.sourcedir = raw_input("Toaster needs to know in which directory it should check out the source code of the layers you will build. The directory should be a parent of the cloned directory for the sources you are using to run Toaster. Toaster will create new clones of the layers, so existing content in the chosen directory will not be changed.\nType the full path to the directory (for example: \"%s\": " % os.environ.get('HOME', '/tmp/'))
115 if len(be.sourcedir) == 0 and len(suggesteddir) > 0: 115 if len(be.sourcedir) == 0 and len(suggesteddir) > 0:
116 be.sourcedir = suggesteddir 116 be.sourcedir = suggesteddir
117 return True 117 return True
118 118
119 if len(be.sourcedir) == 0: 119 if len(be.sourcedir) == 0:
120 print "\n -- Validation: The checkout directory must be set." 120 print "\n -- Validation: The layers checkout directory must be set."
121 is_changed = _update_sourcedir() 121 is_changed = _update_sourcedir()
122 122
123 if not be.sourcedir.startswith("/"): 123 if not be.sourcedir.startswith("/"):
124 print "\n -- Validation: The checkout directory must be set to an absolute path." 124 print "\n -- Validation: The layers checkout directory must be set to an absolute path."
125 is_changed = _update_sourcedir() 125 is_changed = _update_sourcedir()
126 126
127 if not be.sourcedir in DN(__file__): 127 if not be.sourcedir in DN(__file__):
128 print "\n -- Validation: The checkout directory must be a parent of the current checkout." 128 print "\n -- Validation: The layers checkout directory must be a parent of the current checkout."
129 is_changed = _update_sourcedir() 129 is_changed = _update_sourcedir()
130 130
131 if is_changed: 131 if is_changed:
@@ -136,9 +136,9 @@ class Command(NoArgsCommand):
136 def _update_builddir(): 136 def _update_builddir():
137 suggesteddir = self._get_suggested_builddir(be) 137 suggesteddir = self._get_suggested_builddir(be)
138 if len(suggesteddir) > 0: 138 if len(suggesteddir) > 0:
139 be.builddir = raw_input("Toaster needs to know where your build directory is located.\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)) 139 be.builddir = raw_input("Toaster needs to know where your build directory is located.\nThe build directory is where all the artifacts created by your builds will be stored. Toaster suggests \"%s\".\nPress Enter to select \"%s\" or type the full path to a different directory: " % (suggesteddir, suggesteddir))
140 else: 140 else:
141 be.builddir = raw_input("Toaster 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.environ.get('HOME','/tmp/')) 141 be.builddir = raw_input("Toaster needs to know where is your build directory.\nThe 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.environ.get('HOME','/tmp/'))
142 if len(be.builddir) == 0 and len(suggesteddir) > 0: 142 if len(be.builddir) == 0 and len(suggesteddir) > 0:
143 be.builddir = suggesteddir 143 be.builddir = suggesteddir
144 return True 144 return True
@@ -153,7 +153,7 @@ class Command(NoArgsCommand):
153 153
154 154
155 if is_changed: 155 if is_changed:
156 print "Build configuration saved" 156 print "\nBuild configuration saved"
157 be.save() 157 be.save()
158 return True 158 return True
159 159
@@ -180,19 +180,19 @@ class Command(NoArgsCommand):
180 config_files.append(candidatefilepath) 180 config_files.append(candidatefilepath)
181 181
182 if len(config_files) > 0: 182 if len(config_files) > 0:
183 print " Toaster will list now the configuration files that it found. Select the number to use the desired configuration file." 183 print "Toaster will list now the configuration files that it found. Select the number to use the desired configuration file."
184 for cf in config_files: 184 for cf in config_files:
185 print " [%d] - %s" % (config_files.index(cf) + 1, cf) 185 print " [%d] - %s" % (config_files.index(cf) + 1, cf)
186 print "\n [0] - Exit without importing any file" 186 print "\n [0] - Exit without importing any file"
187 try: 187 try:
188 i = raw_input("\n Enter your option: ") 188 i = raw_input("\nEnter your option: ")
189 if len(i) and (int(i) - 1 >= 0 and int(i) - 1 < len(config_files)): 189 if len(i) and (int(i) - 1 >= 0 and int(i) - 1 < len(config_files)):
190 print "Importing file: %s" % config_files[int(i)-1] 190 print "\nImporting file: %s" % config_files[int(i)-1]
191 from loadconf import Command as LoadConfigCommand 191 from loadconf import Command as LoadConfigCommand
192 192
193 LoadConfigCommand()._import_layer_config(config_files[int(i)-1]) 193 LoadConfigCommand()._import_layer_config(config_files[int(i)-1])
194 # we run lsupdates after config update 194 # we run lsupdates after config update
195 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" 195 print "\nLayer configuration imported. Updating information from the layer sources, please wait.\nYou can re-update any time later by running bitbake/lib/toaster/manage.py lsupdates"
196 from django.core.management import call_command 196 from django.core.management import call_command
197 call_command("lsupdates") 197 call_command("lsupdates")
198 198
@@ -202,7 +202,7 @@ class Command(NoArgsCommand):
202 print "Failure while trying to import the toaster config file: %s" % e 202 print "Failure while trying to import the toaster config file: %s" % e
203 traceback.print_exc(e) 203 traceback.print_exc(e)
204 else: 204 else:
205 print "\n Toaster could not find a configuration file. You need to configure Toaster manually using the web interface, or create a configuration file and use\n bitbake/lib/toaster/managepy.py loadconf [filename]\n command to load it. You can use https://wiki.yoctoproject.org/wiki/File:Toasterconf.json.txt.patch as a starting point." 205 print "\nToaster could not find a configuration file. You need to configure Toaster manually using the web interface, or create a configuration file and use\n bitbake/lib/toaster/managepy.py loadconf [filename]\n command to load it. You can use https://wiki.yoctoproject.org/wiki/File:Toasterconf.json.txt.patch as a starting point."
206 206
207 207
208 208