Skip to contentSkip to conversation

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

PATCH In review Denys Dmytriyenko 3 participants 3 messages Apr 22, 2009

lore
Share & tools
lore
#0 lore raw

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

From: Petri Lehtinen <[email protected]>

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

---
 classes/base.bbclass |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)
classes/base.bbclass +13 -9
index 9ec705b..e5fd814 100644
@@ -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
Signature · 1 line
1.6.0.6
Acked-by on v1 1/1
#1 lore raw
Quoted 1 line · Denys Dmytriyenko

From: Petri Lehtinen<[email protected]>

Quoted 52 lines

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

---
  classes/base.bbclass |   22 +++++++++++++---------
  1 files changed, 13 insertions(+), 9 deletions(-)
classes/base.bbclass +13 -9
index 9ec705b..e5fd814 100644
@@ -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
Acked-by
#2 lore raw
Quoted 4 lines · Koen Kooi
Quoted 1 line · Denys Dmytriyenko

From: Petri Lehtinen<[email protected]>

Quoted 60 lines
Quoted 43 lines

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

---
  classes/base.bbclass |   22 +++++++++++++---------
  1 files changed, 13 insertions(+), 9 deletions(-)
classes/base.bbclass +8 -8
index 9ec705b..e5fd814 100644
@@ -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()
 

classes/base.bbclass python base_do_fetch() { · line 636

Quoted 10 lines
classes/base.bbclass +5 -1
+	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

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

Signature · 1 line
Tom Rini