diff options
| author | Justin Patrin <papercrane@gmail.com> | 2007-03-31 16:13:56 +0000 |
|---|---|---|
| committer | Justin Patrin <papercrane@gmail.com> | 2007-03-31 16:13:56 +0000 |
| commit | 649c442569d4c7ce00d7c8634391f2e754bdf2f8 (patch) | |
| tree | 13f29a4a03bd34bf02c102c92863c371c0a0d006 /classes/patch.bbclass | |
| parent | d00c789a09ab7637ecabaa43006efefbb29c093b (diff) | |
| parent | 5d3963de4a236f1a28f4c5c0829d0492141ea505 (diff) | |
merge of 'a664968fa31cd22e4e26d9d058bd6c55d5358c6e'
and 'ce45c8e871ba93b79b522e7311f813a4c79bb08e'
Diffstat (limited to 'classes/patch.bbclass')
| -rw-r--r-- | classes/patch.bbclass | 19 |
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() |
