X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=neve;h=a5ca0d17e605703300c57919cedae997fef1d0df;hb=190b6de9debdd6acaf38c180c42275ac76a90e61;hp=bb8b5f8cee1c25c1e71dc0f16e101e62e018985c;hpb=07241fcd65bb2808804fe2a6e53807997ee9025b;p=dak.git diff --git a/neve b/neve index bb8b5f8c..a5ca0d17 100755 --- a/neve +++ b/neve @@ -1,8 +1,8 @@ #!/usr/bin/env python # Populate the DB -# Copyright (C) 2000 James Troup -# $Id: neve,v 1.1.1.1 2000-11-24 00:20:09 troup Exp $ +# Copyright (C) 2000, 2001 James Troup +# $Id: neve,v 1.4 2001-06-22 22:53:14 troup Exp $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -295,8 +295,7 @@ def do_sources(location, prefix, suite, component, server): sources = location + prefix + 'Sources.gz'; (result, output) = commands.getstatusoutput("gunzip -c %s > %s" % (sources, temp_filename)); if (result != 0): - sys.stderr.write("Gunzip invocation failed!\n%s\n" % (output)); - sys.exit(result); + utils.fubar("Gunzip invocation failed!\n%s" % (output), result); print 'Processing '+sources+'...'; process_sources (location, temp_filename, suite, component, server); os.unlink(temp_filename); @@ -317,7 +316,7 @@ def main (): sys.exit(2) print output - projectB = pg.connect('projectb', 'localhost', -1, None, None, 'postgres') + projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]), None, None, 'postgres') db_access.init (Cnf, projectB); @@ -358,8 +357,7 @@ def main (): # prefix = component + '/' # do_sources(location, prefix); else: - sys.stderr.write("Unknown location type ('%s').\n" % (type)); - sys.exit(2); + utils.fubar("Unknown location type ('%s')." % (type)); # Process Packages files to populate `binaries' and friends @@ -412,8 +410,7 @@ def main (): (result, output) = commands.getstatusoutput("psql projectb < add_constraints.sql"); print output if (result != 0): - sys.stderr.write("psql invocation failed!\n"); - sys.exit(result); + utils.fubar("psql invocation failed!\n%s" % (output), result); return;