summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--classes/patch.bbclass19
-rw-r--r--contrib/qa/checksum/.mtn2git_empty0
-rw-r--r--contrib/qa/checksum/checksum.py74
-rw-r--r--contrib/qa/checksum/sample.conf9
-rw-r--r--contrib/qa/checksum/test.file0
-rw-r--r--packages/efl/edje-native_0.5.0.037.bb4
6 files changed, 97 insertions, 9 deletions
diff --git a/classes/patch.bbclass b/classes/patch.bbclass
index 0a7b94cffc..07d18470f7 100644
--- a/classes/patch.bbclass
+++ b/classes/patch.bbclass
@@ -3,10 +3,20 @@
def patch_init(d):
import os, sys
+ class NotFoundError(Exception):
+ def __init__(self, path):
+ self.path = path
+ def __str__(self):
+ return "Error: %s not found." % self.path
+
def md5sum(fname):
import md5, sys
- f = file(fname, 'rb')
+ try:
+ f = file(fname, 'rb')
+ except IOError:
+ raise NotFoundError(fname)
+
m = md5.new()
while True:
d = f.read(8096)
@@ -24,11 +34,6 @@ def patch_init(d):
def __str__(self):
return "Command Error: exit status: %d Output:\n%s" % (self.status, self.output)
- class NotFoundError(Exception):
- def __init__(self, path):
- self.path = path
- def __str__(self):
- return "Error: %s not found." % self.path
def runcmd(args, dir = None):
import commands
@@ -482,7 +487,7 @@ python patch_do_patch() {
bb.note("Applying patch '%s'" % pname)
try:
patchset.Import({"file":unpacked, "remote":url, "strippath": pnum}, True)
- except NotFoundError:
+ except:
import sys
raise bb.build.FuncFailed(str(sys.exc_value))
resolver.Resolve()
diff --git a/contrib/qa/checksum/.mtn2git_empty b/contrib/qa/checksum/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/contrib/qa/checksum/.mtn2git_empty
diff --git a/contrib/qa/checksum/checksum.py b/contrib/qa/checksum/checksum.py
new file mode 100644
index 0000000000..6880f045d3
--- /dev/null
+++ b/contrib/qa/checksum/checksum.py
@@ -0,0 +1,74 @@
+#
+# Helper utilitiy to verify checksums of SRC_URI's
+#
+# To ease parsing I will use INI files to contain the
+# checksums, at least they will force some kind of structure. This allows
+# to easily add and replace new sums
+#
+#
+# Example:
+# [PN-PV-filename]
+# md5=THESUM
+# sha256=OTHERSUM
+#
+# [PN-filename]
+# md5=THESUM
+# sha256=OTHERSUM
+
+
+def verify_file(config_path, pn, pv, src_uri, localpath):
+ """
+ Verify using the INI file at config_path and check that
+ the localpath matches the one specified by the PN-PV-SRCURI
+ inside the ini file
+ """
+ import ConfigParser, os
+ parser = ConfigParser.ConfigParser()
+ if not len(parser.read(config_path)) == 1:
+ raise Exception("Can not open the '%s'" % config_path)
+
+ # Try PN-PV-SRC_URI first and then try PN-SRC_URI
+ # we rely on the get method to create errors
+ pn_pv_src = "%s-%s-%s" % (pn,pv,src_uri)
+ pn_src = "%s-%s" % (pn,src_uri)
+ if parser.has_section(pn_pv_src):
+ md5 = parser.get(pn_pv_src, "md5")
+ sha256 = parser.get(pn_pv_src, "sha256")
+ elif parser.has_section(pn_src):
+ md5 = parser.get(pn_src, "md5")
+ sha256 = parser.get(pn_src, "sha256")
+ else:
+ raise Exception("Can not find a section for '%s' '%s' and '%s'" % (pn,pv,src_uri))
+
+ # md5 and sha256 should be valid now
+ if not os.path.exists(localpath):
+ raise Exception("The path does not exist '%s'" % localpath)
+
+
+ # call md5(sum) and shasum
+ try:
+ md5pipe = os.popen('md5sum ' + localpath)
+ md5data = (md5pipe.readline().split() or [ "" ])[0]
+ md5pipe.close()
+ except OSError:
+ raise Exception("Executing md5sum failed")
+
+ try:
+ shapipe = os.popen('shasum -a256 -p ' + localpath)
+ shadata = (shapipe.readline().split() or [ "" ])[0]
+ shapipe.close()
+ except OSError:
+ raise Exception("Executing shasum failed")
+
+ if not md5 == md5data:
+ raise Exception("MD5 Sums do not match. Wanted: '%s' Got: '%s'" % (md5, md5data))
+
+ if not sha256 == shadata:
+ raise Exception("SHA256 Sums do not match. Wanted: '%s' Got: '%s'" % (sha256, shadata))
+
+
+ return True
+
+
+# Test it
+verify_file("sample.conf", "qtopia-core", "4.3.0", "ftp://ftp.trolltech.com/qt/source/qtopia-core-opensource-4.2.3.tar.gz", "test.file")
diff --git a/contrib/qa/checksum/sample.conf b/contrib/qa/checksum/sample.conf
new file mode 100644
index 0000000000..478a9a05f9
--- /dev/null
+++ b/contrib/qa/checksum/sample.conf
@@ -0,0 +1,9 @@
+[qtopia-core-4.3-ftp://ftp.trolltech.com/qt/source/qtopia-core-opensource-4.3.0beta.tar.gz]
+md5=123
+sha256=1000
+
+[qtopia-core-ftp://ftp.trolltech.com/qt/source/qtopia-core-opensource-4.2.3.tar.gz]
+md5=d41d8cd98f00b204e9800998ecf8427e
+sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
+
+# Test commets and such
diff --git a/contrib/qa/checksum/test.file b/contrib/qa/checksum/test.file
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/contrib/qa/checksum/test.file
diff --git a/packages/efl/edje-native_0.5.0.037.bb b/packages/efl/edje-native_0.5.0.037.bb
index 2b8c43644a..4e878ab204 100644
--- a/packages/efl/edje-native_0.5.0.037.bb
+++ b/packages/efl/edje-native_0.5.0.037.bb
@@ -1,5 +1,5 @@
require edje_${PV}.bb
-PR = "r3"
+PR = "r4"
inherit native
@@ -13,7 +13,7 @@ do_configure_prepend() {
}
do_install_append() {
- edje_data_dir=`edje-config --datadir`
+ edje_data_dir=`${S}/edje-config --datadir`
# could also use ${STAGING_DATADIR}/edje/include
install -d $edje_data_dir/include
install -m 0644 data/include/edje.inc $edje_data_dir/include