X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=neve;h=a23abb706f51803a34e4967c24d1c1b086825e08;hb=41b58850cb71d3fa204810b19cb0e00a46992fdb;hp=a1f6c8cf2cc17c34086ed044de96f517c25712e9;hpb=c06dd5b8fc75e69389949a046d6fe8ba9b01abf3;p=dak.git diff --git a/neve b/neve index a1f6c8cf..a23abb70 100755 --- a/neve +++ b/neve @@ -1,8 +1,8 @@ #!/usr/bin/env python # Populate the DB -# Copyright (C) 2000, 2001, 2002, 2003 James Troup -# $Id: neve,v 1.18 2003-02-07 14:53:42 troup Exp $ +# Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup +# $Id: neve,v 1.20 2004-06-17 14:59:57 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 @@ -37,7 +37,7 @@ ############################################################################### -import commands, os, pg, re, sys, tempfile, time; +import commands, os, pg, re, sys, time; import apt_pkg; import db_access, utils; @@ -310,7 +310,7 @@ def get_or_set_files_id (filename, size, md5sum, location_id): cache_key = "~".join((filename, size, md5sum, repr(location_id))); if not files_id_cache.has_key(cache_key): files_id_serial += 1 - files_query_cache.write("%d\t%s\t%s\t%s\t%d\n" % (files_id_serial, filename, size, md5sum, location_id)); + files_query_cache.write("%d\t%s\t%s\t%s\t%d\t\\N\n" % (files_id_serial, filename, size, md5sum, location_id)); files_id_cache[cache_key] = files_id_serial return files_id_cache[cache_key] @@ -474,9 +474,7 @@ def process_packages (filename, suite, component, archive): ############################################################################### def do_sources(sources, suite, component, server): - temp_filename = tempfile.mktemp(); - fd = os.open(temp_filename, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0700); - os.close(fd); + temp_filename = utils.temp_filename(); (result, output) = commands.getstatusoutput("gunzip -c %s > %s" % (sources, temp_filename)); if (result != 0): utils.fubar("Gunzip invocation failed!\n%s" % (output), result);