[oe-commits] Petri Lehtinen : base.bbclass: Combine all checksum. ini files found in BBPATH

GIT User account git at amethyst.openembedded.net
Tue Apr 21 18:50:52 UTC 2009


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 4b48c66ff661c3b88f85dee62517a31ae66db242
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=4b48c66ff661c3b88f85dee62517a31ae66db242

Author: Petri Lehtinen <petri.lehtinen at inoi.fi>
Date:   Tue Apr 14 21:59:55 2009 +0000

base.bbclass: Combine all checksum.ini files found in BBPATH

This makes it possible for overlays to have checksum.ini.

Signed-off-by: Petri Lehtinen <petri.lehtinen at inoi.fi>
Acked-by: Khem Raj <raj.khem at gmail.com>
Acked-by: Denys Dmytriyenko <denis at denix.org>
Acked-by: Chris Larson <clarson at kergoth.com>
Acked-by: Otavio Salvador <otavio at ossystems.com.br>

---

 classes/base.bbclass |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/classes/base.bbclass b/classes/base.bbclass
index 9ec705b..e5fd814 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -40,12 +40,11 @@ def base_path_relative(src, dest):
     return sep.join(relpath)
 
 # for MD5/SHA handling
-def base_chk_load_parser(config_path):
+def base_chk_load_parser(config_paths):
     import ConfigParser, os, bb
     parser = ConfigParser.ConfigParser()
-    if not len(parser.read(config_path)) == 1:
-        bb.note("Can not open the '%s' ini file" % config_path)
-        raise Exception("Can not open the '%s'" % config_path)
+    if len(parser.read(config_paths)) < 1:
+        raise ValueError("no ini files could be found")
 
     return parser
 
@@ -620,13 +619,18 @@ python base_do_fetch() {
 
 	# Verify the SHA and MD5 sums we have in OE and check what do
 	# in
-	check_sum = bb.which(bb.data.getVar('BBPATH', d, True), "conf/checksums.ini")
-	if not check_sum:
-		bb.note("No conf/checksums.ini found, not checking checksums")
-		return
+	checksum_paths = bb.data.getVar('BBPATH', d, True).split(":")
+
+	# reverse the list to give precedence to directories that
+	# appear first in BBPATH
+	checksum_paths.reverse()
 
+	checksum_files = ["%s/conf/checksums.ini" % path for path in checksum_paths]
 	try:
-		parser = base_chk_load_parser(check_sum)
+		parser = base_chk_load_parser(checksum_files)
+	except ValueError:
+		bb.note("No conf/checksums.ini found, not checking checksums")
+		return
 	except:
 		bb.note("Creating the CheckSum parser failed")
 		return





More information about the Openembedded-commits mailing list