Skip to contentSkip to conversation

bitbake: Check if bitbake versions match

PATCH New Ed Bartosh 1 participant 1 message Apr 28, 2015

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 bitbake: Check if bitbake versions match

Bitbake program and core versions must match.

Moved __version__ from main.py back to bin/bitbake. Implemented check for version match in bin/bitbake.

tbs

---
 bitbake/bin/bitbake    | 4 ++++
 bitbake/lib/bb/main.py | 3 +--
 2 files changed, 5 insertions(+), 2 deletions(-)
bitbake/bin/bitbake +4 -0
index 3e1ca62..88ac8c3 100755
@@ -35,7 +35,11 @@ except RuntimeError as exc:
 from bb import cookerdata
 from bb.main import bitbake_main, BitBakeConfigParameters, BBMainException
 
+__version__ = "1.27.0"
+
 if __name__ == "__main__":
+    if __version__ != bb.__version__:
+        sys.exit("Bitbake core version and program version mismatch!")
     try:
         ret = bitbake_main(BitBakeConfigParameters(sys.argv),
                            cookerdata.CookerConfiguration())
bitbake/lib/bb/main.py +1 -2
index 2019d50..49dc8d5 100755
@@ -36,7 +36,6 @@ from bb import ui
 from bb import server
 from bb import cookerdata
 
-__version__ = "1.27.0"
 logger = logging.getLogger("BitBake")
 
 class BBMainException(Exception):
@@ -83,7 +82,7 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
 
     def parseCommandLine(self, argv=sys.argv):
         parser = optparse.OptionParser(
-            version = "BitBake Build Tool Core version %s, %%prog version %s" % (bb.__version__, __version__),
+            version = "BitBake Build Tool Core version %s" % bb.__version__,
             usage = """%prog [options] [recipename/target ...]
 
     Executes the specified task (default is 'build') for a given set of target recipes (.bb files).
Signature · 1 line
2.1.4