summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Remmet <j.remmet@phytec.de>2017-12-15 11:45:03 +0100
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2017-12-15 16:36:37 +0100
commit6768fa2e2756a88fcb56fc710e99d09c5ad4f830 (patch)
treeb4e02b6ddd05f0a9962c31c70b70bd0e7055fbb0
parent161a2c74a7641b4b9612cfd88eb903a49523db22 (diff)
downloadmeta-phytec-6768fa2e2756a88fcb56fc710e99d09c5ad4f830.tar.bz2
meta-phytec-6768fa2e2756a88fcb56fc710e99d09c5ad4f830.zip
scripts: switch_machine: conditionally modify confnotes
don't modify confnotes if there is no target selected. Used by KSP Layer which want to show confnotes unmodified to offer various targets. Signed-off-by: Jan Remmet <j.remmet@phytec.de> Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
-rwxr-xr-xscripts/switch_machine.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/scripts/switch_machine.py b/scripts/switch_machine.py
index 29101f2..9421b3f 100755
--- a/scripts/switch_machine.py
+++ b/scripts/switch_machine.py
@@ -66,15 +66,16 @@ class BSP_Switcher(BoardSupportPackage):
# write build target to conf-notex.txt so it will be displayed after
# sourcing the environment
- confnotes = os.path.join(self.src.bsp_dir, 'tools', 'templateconf', 'conf-notes.txt')
- f = open(confnotes, 'r')
- lines = f.readlines()
- f.close()
- f = open(confnotes, 'w')
- f.writelines([l for l in lines[:-2]])
- print('set TARGET in conf-notes.txt to %s' % target)
- f.write(' $ bitbake %s\n\n' % target)
- f.close()
+ if target:
+ confnotes = os.path.join(self.src.bsp_dir, 'tools', 'templateconf', 'conf-notes.txt')
+ f = open(confnotes, 'r')
+ lines = f.readlines()
+ f.close()
+ f = open(confnotes, 'w')
+ f.writelines([l for l in lines[:-2]])
+ print('set TARGET in conf-notes.txt to %s' % target)
+ f.write(' $ bitbake %s\n\n' % target)
+ f.close()
return self.write_machine_to_localconf()