summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py21
-rw-r--r--bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py2
2 files changed, 15 insertions, 8 deletions
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"