#!/usr/bin/env python
# Populate the DB
-# Copyright (C) 2000 James Troup <james@nocrew.org>
-# $Id: neve,v 1.1.1.1 2000-11-24 00:20:09 troup Exp $
+# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
+# $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
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);
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);
# 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
(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;