diff --git a/debian/bin/abiupdate.py b/debian/bin/abiupdate.py index cbe305ab8..3ce03eab1 100755 --- a/debian/bin/abiupdate.py +++ b/debian/bin/abiupdate.py @@ -4,7 +4,7 @@ import sys sys.path.append(sys.path[0] + "/../lib/python") import optparse, os, shutil, tempfile, urllib2 -from debian_linux.abi import * +from debian_linux.abi import Symbols from debian_linux.config import * from debian_linux.debian import * @@ -76,7 +76,7 @@ class main(object): f = self.retrieve_package(self.url, filename) d = self.extract_package(f, "linux-headers-%s_%s" % (prefix, arch)) f1 = d + "/usr/src/linux-headers-%s-%s/Module.symvers" % (self.version_abi, prefix) - s = symbols(f1) + s = Symbols(f1) shutil.rmtree(d) return s @@ -92,7 +92,12 @@ class main(object): def retrieve_package(self, url, filename): u = url(self.source, filename) filename_out = self.dir + "/" + filename - f_in = urllib2.urlopen(u) + + try: + f_in = urllib2.urlopen(u) + except urllib2.HTTPError, e: + raise RuntimeError('Failed to retrieve %s: %s' % (e.filename, e)) + f_out = file(filename_out, 'w') while 1: r = f_in.read() @@ -106,7 +111,7 @@ class main(object): if not os.path.exists(dir): os.makedirs(dir) out = "%s/%s_%s_%s" % (dir, arch, featureset, flavour) - symbols.write(file(out, 'w')) + Symbols.write(file(out, 'w')) def update_arch(self, config, arch): if self.override_featureset: @@ -145,10 +150,7 @@ class main(object): abi = self.get_abi(arch, localversion) self.save_abi(abi, arch, featureset, flavour) self.log("Ok.\n") - except KeyboardInterrupt: - self.log("Interrupted!\n") - sys.exit(1) - except Exception, e: + except StandardError, e: self.log("FAILED! (%s)\n" % str(e)) if __name__ == '__main__':