bitbake: toaster: improve explanation of checkout dir
PATCH 1/1 bitbake: toaster: improve explanation of checkout dir
From: Belen Barros Pena <[email protected]>
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]
--- .../management/commands/checksettings.py | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-)
bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py +16 -16
@@ -69,8 +69,8 @@ class Command(NoArgsCommand): # verify that we have a settings for downloading artifacts while ToasterSetting.objects.filter(name="ARTIFACTS_STORAGE_DIR").count() == 0: guessedpath = os.getcwd() + "/toaster_build_artifacts/" - print("Toaster needs to know in which directory it can download build log files and other artifacts.\n Toaster suggests \"%s\"." % guessedpath) - artifacts_storage_dir = raw_input(" Press Enter to select \"%s\" or type the full path to a different directory: " % guessedpath) + print("\nToaster needs to know in which directory it can download build log files and other artifacts.\nToaster suggests \"%s\"." % guessedpath) + artifacts_storage_dir = raw_input("Press Enter to select \"%s\" or type the full path to a different directory: " % guessedpath) if len(artifacts_storage_dir) == 0: artifacts_storage_dir = guessedpath if len(artifacts_storage_dir) > 0 and artifacts_storage_dir.startswith("/"):
@@ -104,28 +104,28 @@ class Command(NoArgsCommand): be.needs_import = False def _verify_be(): is_changed = False - print("Verifying the Build Environment. If the local Build Environment is not properly configured, you will be asked to configure it.") + print("\nVerifying the build environment. If the local build environment is not properly configured, you will be asked to configure it.") def _update_sourcedir(): suggesteddir = self._get_suggested_sourcedir(be) if len(suggesteddir) > 0: - 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)) + 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)) else: - 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/')) + 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/')) if len(be.sourcedir) == 0 and len(suggesteddir) > 0: be.sourcedir = suggesteddir return True if len(be.sourcedir) == 0: - print "\n -- Validation: The checkout directory must be set." + print "\n -- Validation: The layers checkout directory must be set." is_changed = _update_sourcedir() if not be.sourcedir.startswith("/"): - print "\n -- Validation: The checkout directory must be set to an absolute path." + print "\n -- Validation: The layers checkout directory must be set to an absolute path." is_changed = _update_sourcedir() if not be.sourcedir in DN(__file__): - print "\n -- Validation: The checkout directory must be a parent of the current checkout." + print "\n -- Validation: The layers checkout directory must be a parent of the current checkout." is_changed = _update_sourcedir() if is_changed:
@@ -136,9 +136,9 @@ class Command(NoArgsCommand): def _update_builddir(): suggesteddir = self._get_suggested_builddir(be) if len(suggesteddir) > 0: - 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)) + 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)) else: - 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/')) + 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/')) if len(be.builddir) == 0 and len(suggesteddir) > 0: be.builddir = suggesteddir return True
@@ -153,7 +153,7 @@ class Command(NoArgsCommand): if is_changed: - print "Build configuration saved" + print "\nBuild configuration saved" be.save() return True
@@ -180,19 +180,19 @@ class Command(NoArgsCommand): config_files.append(candidatefilepath) if len(config_files) > 0: - print " Toaster will list now the configuration files that it found. Select the number to use the desired configuration file." + print "Toaster will list now the configuration files that it found. Select the number to use the desired configuration file." for cf in config_files: print " [%d] - %s" % (config_files.index(cf) + 1, cf) print "\n [0] - Exit without importing any file" try: - i = raw_input("\n Enter your option: ") + i = raw_input("\nEnter your option: ") if len(i) and (int(i) - 1 >= 0 and int(i) - 1 < len(config_files)): - print "Importing file: %s" % config_files[int(i)-1] + print "\nImporting file: %s" % config_files[int(i)-1] from loadconf import Command as LoadConfigCommand LoadConfigCommand()._import_layer_config(config_files[int(i)-1]) # we run lsupdates after config update - 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" + 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" from django.core.management import call_command call_command("lsupdates")
@@ -202,7 +202,7 @@ class Command(NoArgsCommand): print "Failure while trying to import the toaster config file: %s" % e traceback.print_exc(e) else: - 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." + 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."
Signature · 1 line
2.3.2 (Apple Git-55)
Submitted to bitbake-devel.
Elliot
Quoted 214 lines · Belen Barros Pena
From: Belen Barros Pena <[email protected]>
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]
Signed-off-by Belen Barros Pena <[email protected]>--- .../management/commands/checksettings.py | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-)diff --git
a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.pyb/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.pyindex 83b4f28..3ccc7c6 100644bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py +0
-0@@ -69,8 +69,8 @@ class Command(NoArgsCommand): # verify that we have a settings for downloading artifacts whileToasterSetting.objects.filter(name="ARTIFACTS_STORAGE_DIR").count() == 0:
guessedpath =os.getcwd()+ "/toaster_build_artifacts/"
- print("Toaster needs to know in which directory it can
download build log files and other artifacts.\n Toaster suggests \"%s\"." % guessedpath)
-artifacts_storage_dir= raw_input(" Press Enter to select
\"%s\" or type the full path to a different directory: " % guessedpath)
+ print("\nToaster needs to know in which directory it can
download build log files and other artifacts.\nToaster suggests \"%s\"." % guessedpath)
+artifacts_storage_dir= raw_input("Press Enter to select
\"%s\" or type the full path to a different directory: " % guessedpath)
iflen(artifacts_storage_dir)== 0:
artifacts_storage_dir= guessedpath
iflen(artifacts_storage_dir)> 0 andartifacts_storage_dir.startswith("/"):bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py +0
-1@@ -104,28 +104,28 @@ class Command(NoArgsCommand): be.needs_import = False def _verify_be(): is_changed = False - print("Verifying the Build Environment. If the localBuild Environment is not properly configured, you will be asked to configure it.")
+ print("\nVerifying the build environment. If the local
build environment is not properly configured, you will be asked to configure it.")def
_update_sourcedir():
suggesteddir =self._get_suggested_sourcedir(be)if len(suggesteddir) > 0:
- 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))
+ 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))
else:
- 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/'))
+ 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/'))if len(be.sourcedir) == 0 and len(suggesteddir) > 0: be.sourcedir = suggesteddir return True if len(be.sourcedir) == 0:- print "\n -- Validation: The checkout directory must
be set."
+ print "\n -- Validation: The layers checkout
directory must be set."
is_changed=_update_sourcedir()if not
be.sourcedir.startswith("/"):
- print "\n -- Validation: The checkout directory must
be set to an absolute path."
+ print "\n -- Validation: The layers checkout
directory must be set to an absolute path."
is_changed=_update_sourcedir()if not be.sourcedir in
DN(__file__):
- print "\n -- Validation: The checkout directory must
be a parent of the current checkout."
+ print "\n -- Validation: The layers checkout
directory must be a parent of the current checkout."
is_changed=_update_sourcedir()if
is_changed:bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py +0
-1@@ -136,9 +136,9 @@ class Command(NoArgsCommand): def _update_builddir(): suggesteddir = self._get_suggested_builddir(be) if len(suggesteddir) > 0: - be.builddir = raw_input("Toaster needs to knowwhere 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))
+ 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))
else:
- 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/'))
+ 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/'))
if len(be.builddir) == 0 and len(suggesteddir) > 0:
be.builddir = suggesteddir
return Truebitbake/lib/toaster/bldcontrol/management/commands/checksettings.py +1
-2@@ -153,7 +153,7 @@ class Command(NoArgsCommand): if is_changed: - print "Build configuration saved" + print "\nBuild configuration saved" be.save() return True@@ -180,19 +180,19 @@ class Command(NoArgsCommand): config_files.append(candidatefilepath) if len(config_files) > 0: - print " Toaster will list now the configurationfiles that it found. Select the number to use the desired configuration file."
+ print "Toaster will list now the configuration
files that it found. Select the number to use the desired configuration file."
for cf inconfig_files:
print " [%d] - %s" % (config_files.index(cf)
+ 1, cf)
print "\n [0] - Exit without importing any file" try:bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py +1
-3- i = raw_input("\n Enter your option: ") + i = raw_input("\nEnter your option: ") if len(i) and (int(i) - 1 >= 0 and int(i) - 1 < len(config_files)): - print "Importing file: %s" %config_files[int(i)-1]
+ print "\nImporting file: %s" %
config_files[int(i)-1]
from loadconf import Command as
LoadConfigCommandLoadConfigCommand()._import_layer_config(config_files[int(i)-1])
# we run lsupdates after config update - 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" + 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" from django.core.management import call_command call_command("lsupdates")bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py +0
-0@@ -202,7 +202,7 @@ class Command(NoArgsCommand): print "Failure while trying to import thetoaster config file: %s" % e
traceback.print_exc(e)
else:
- 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\nbitbake/lib/toaster/managepy.pyloadconf [filename]\n command to load it. You can use
https://wiki.yoctoproject.org/wiki/File:Toasterconf.json.txt.patch as a starting point."
+ 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\nbitbake/lib/toaster/managepy.pyloadconf [filename]\n command to load it. You can use
https://wiki.yoctoproject.org/wiki/File:Toasterconf.json.txt.patch as a starting point."--
2.3.2 (Apple Git-55)--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster
Signature · 3 lines
Elliot Smith Software Engineer Intel Open Source Technology Centre