diff options
| author | Shane Volpe <shanevolpe@gmail.com> | 2007-04-07 20:23:43 +0000 |
|---|---|---|
| committer | Shane Volpe <shanevolpe@gmail.com> | 2007-04-07 20:23:43 +0000 |
| commit | 3a5e5c11ca9e5d3686fce546e33eacc62f5e7dcd (patch) | |
| tree | 4f25aacf8558a773fad14e0018d4afb9f560237f /classes/patch.bbclass | |
| parent | 1ff6665ead8253bb6adde2afeb004f9ef625f4f4 (diff) | |
| parent | 2effa2e0213c0cecaf6d3a0ca7390a288ebc9908 (diff) | |
merge of '59b19c7d48e754418caf1f4214b1ce53d2cca5c4'
and 'f4a044e0ef8b886ef1bdc74ae09f12874ddf7130'
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() |
