-# Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup <james@nocrew.org>
-# $Id: tea,v 1.31 2004-11-27 18:03:11 troup Exp $
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006 James Troup <james@nocrew.org>
# 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
# 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
################################################################################
import commands, os, pg, stat, string, sys, time
################################################################################
import commands, os, pg, stat, string, sys, time
Run various sanity checks of the archive and/or database.
-h, --help show this help and exit.
Run various sanity checks of the archive and/or database.
-h, --help show this help and exit.
filename = os.path.abspath(i[0] + i[1])
db_files[filename] = ""
if os.access(filename, os.R_OK) == 0:
filename = os.path.abspath(i[0] + i[1])
db_files[filename] = ""
if os.access(filename, os.R_OK) == 0:
continue
component = component.lower()
list_filename = '%s%s_%s_source.list' % (Cnf["Dir::Lists"], suite, component)
continue
component = component.lower()
list_filename = '%s%s_%s_source.list' % (Cnf["Dir::Lists"], suite, component)
- utils.parse_changes(file, signing_rules=1)
- except utils.invalid_dsc_format_exc, line:
- utils.warn("syntax error in .dsc file '%s', line %s." % (file, line))
+ dak.lib.utils.parse_changes(file, signing_rules=1)
+ except dak.lib.utils.invalid_dsc_format_exc, line:
+ dak.lib.utils.warn("syntax error in .dsc file '%s', line %s." % (file, line))
q = projectB.query("""
SELECT DISTINCT b.package FROM binaries b, bin_associations ba
WHERE b.id = ba.bin AND ba.suite = %s AND NOT EXISTS
q = projectB.query("""
SELECT DISTINCT b.package FROM binaries b, bin_associations ba
WHERE b.id = ba.bin AND ba.suite = %s AND NOT EXISTS
- utils.warn("**WARNING** md5sum mismatch for '%s' ('%s' [current] vs. '%s' [db])." % (filename, md5sum, db_md5sum))
+ dak.lib.utils.warn("**WARNING** md5sum mismatch for '%s' ('%s' [current] vs. '%s' [db])." % (filename, md5sum, db_md5sum))
- utils.warn("**WARNING** size mismatch for '%s' ('%s' [current] vs. '%s' [db])." % (filename, size, db_size))
+ dak.lib.utils.warn("**WARNING** size mismatch for '%s' ('%s' [current] vs. '%s' [db])." % (filename, size, db_size))
for i in ql:
filename = os.path.abspath(i[0] + i[1])
if os.access(filename, os.R_OK):
for i in ql:
filename = os.path.abspath(i[0] + i[1])
if os.access(filename, os.R_OK):
current_file = filename
sys.stderr.write("Processing %s.\n" % (filename))
apt_inst.debExtract(file,Ent,"control.tar.gz")
current_file = filename
sys.stderr.write("Processing %s.\n" % (filename))
apt_inst.debExtract(file,Ent,"control.tar.gz")
- utils.fubar("error parsing .dsc file '%s'." % (filename))
- dsc_files = utils.build_file_list(dsc, is_a_dsc=1)
+ dak.lib.utils.fubar("error parsing .dsc file '%s'." % (filename))
+ dsc_files = dak.lib.utils.build_file_list(dsc, is_a_dsc=1)
filename = "%s/dists/%s/%s/source/Sources.gz" % (Cnf["Dir::Root"], suite, component)
print "Processing %s..." % (filename)
# apt_pkg.ParseTagFile needs a real file handle and can't handle a GzipFile instance...
filename = "%s/dists/%s/%s/source/Sources.gz" % (Cnf["Dir::Root"], suite, component)
print "Processing %s..." % (filename)
# apt_pkg.ParseTagFile needs a real file handle and can't handle a GzipFile instance...
(result, output) = commands.getstatusoutput("gunzip -c %s > %s" % (filename, temp_filename))
if (result != 0):
sys.stderr.write("Gunzip invocation failed!\n%s\n" % (output))
sys.exit(result)
(result, output) = commands.getstatusoutput("gunzip -c %s > %s" % (filename, temp_filename))
if (result != 0):
sys.stderr.write("Gunzip invocation failed!\n%s\n" % (output))
sys.exit(result)
pool_filename = "%s/%s/%s" % (Cnf["Dir::Pool"], pool_location, name)
if not os.path.exists(pool_filename):
print "E: %s missing (%s)." % (filename, pool_filename)
pool_filename = "%s/%s/%s" % (Cnf["Dir::Pool"], pool_location, name)
if not os.path.exists(pool_filename):
print "E: %s missing (%s)." % (filename, pool_filename)
print "Symlinking: %s -> %s" % (filename, src)
#os.symlink(src, filename)
sources.close()
print "Symlinking: %s -> %s" % (filename, src)
#os.symlink(src, filename)
sources.close()
% (Cnf["Dir::Root"], suite, component, architecture)
print "Processing %s..." % (filename)
# apt_pkg.ParseTagFile needs a real file handle and can't handle a GzipFile instance...
% (Cnf["Dir::Root"], suite, component, architecture)
print "Processing %s..." % (filename)
# apt_pkg.ParseTagFile needs a real file handle and can't handle a GzipFile instance...
(result, output) = commands.getstatusoutput("gunzip -c %s > %s" % (filename, temp_filename))
if (result != 0):
sys.stderr.write("Gunzip invocation failed!\n%s\n" % (output))
sys.exit(result)
(result, output) = commands.getstatusoutput("gunzip -c %s > %s" % (filename, temp_filename))
if (result != 0):
sys.stderr.write("Gunzip invocation failed!\n%s\n" % (output))
sys.exit(result)
Packages = apt_pkg.ParseTagFile(packages)
while Packages.Step():
filename = "%s/%s" % (Cnf["Dir::Root"], Packages.Section.Find('Filename'))
Packages = apt_pkg.ParseTagFile(packages)
while Packages.Step():
filename = "%s/%s" % (Cnf["Dir::Root"], Packages.Section.Find('Filename'))
filename = os.path.normpath(i[0] + i[1])
# file_id = i[2]
if os.access(filename, os.R_OK) == 0:
filename = os.path.normpath(i[0] + i[1])
# file_id = i[2]
if os.access(filename, os.R_OK) == 0:
# You probably don't want to use the rest of this...
# print "%s: is a symlink." % (filename)
# dest = os.readlink(filename)
# You probably don't want to use the rest of this...
# print "%s: is a symlink." % (filename)
# dest = os.readlink(filename)
# new_filename = dest.replace(location, "")
# q = projectB.query("UPDATE files SET filename = '%s', location = %s WHERE id = %s" % (new_filename, location_id, file_id))
# q = projectB.query("COMMIT WORK")
# new_filename = dest.replace(location, "")
# q = projectB.query("UPDATE files SET filename = '%s', location = %s WHERE id = %s" % (new_filename, location_id, file_id))
# q = projectB.query("COMMIT WORK")
for field_name in [ "build-depends", "build-depends-indep" ]:
field = dsc.get(field_name)
if field:
for field_name in [ "build-depends", "build-depends-indep" ]:
field = dsc.get(field_name)
if field:
def main ():
global Cnf, projectB, db_files, waste, excluded
def main ():
global Cnf, projectB, db_files, waste, excluded
- Cnf = utils.get_conf()
- Arguments = [('h',"help","Tea::Options::Help")]
+ Cnf = dak.lib.utils.get_conf()
+ Arguments = [('h',"help","Check-Archive::Options::Help")]
usage(1)
################################################################################
if __name__ == '__main__':
main()
usage(1)
################################################################################
if __name__ == '__main__':
main()