summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2007-03-31 15:58:15 +0000
committerHolger Freyther <zecke@selfish.org>2007-03-31 15:58:15 +0000
commit5d3963de4a236f1a28f4c5c0829d0492141ea505 (patch)
treebd9944aa6f69adeb8c1e630cb89a9ce12d8854c9
parent0a9ddb4c6b3f4fe6a13cb01a92f0abf152ad5919 (diff)
parentf4a53b765a6801f836586b5ee662b5f9392dcfab (diff)
merge of '2b9fbd2b94d0dd1a3b6560f1e64c3ba54d0491c9'
and 'a1ada670e1090a4a0d8aeca19ac7ce206efe34ba'
-rw-r--r--classes/patch.bbclass19
1 files changed, 12 insertions, 7 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()