X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fcheck_proposed_updates.py;h=5b9283f712e3cee0d54711991ec795cb2c760ea8;hb=c6afcd6e86b80cc2a489872790d4a59007038e41;hp=0dafb64885bc25e405fb1321fcbef452d4b9a267;hpb=7aaaad3135c9164390af5897925660842368660b;p=dak.git diff --git a/dak/check_proposed_updates.py b/dak/check_proposed_updates.py index 0dafb648..5b9283f7 100755 --- a/dak/check_proposed_updates.py +++ b/dak/check_proposed_updates.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Dependency check proposed-updates +""" Dependency check proposed-updates """ # Copyright (C) 2001, 2002, 2004, 2006 James Troup # This program is free software; you can redistribute it and/or modify @@ -20,18 +20,19 @@ ################################################################################ # | > amd64 is more mature than even some released architectures -# | +# | # | This might be true of the architecture, unfortunately it seems to be the # | exact opposite for most of the people involved with it. -# +# # <1089213290.24029.6.camel@descent.netsplit.com> ################################################################################ import pg, sys, os import apt_pkg, apt_inst -import dak.lib.database as database -import dak.lib.utils as utils +from daklib import database +from daklib import utils +from daklib.regexes import re_no_epoch ################################################################################ @@ -91,7 +92,7 @@ def check_dep (depends, dep_type, check_archs, filename, files): unsat = 0 break # As part of the same .changes? - epochless_version = utils.re_no_epoch.sub('', version) + epochless_version = re_no_epoch.sub('', version) dep_filename = "%s_%s_%s.deb" % (dep, epochless_version, arch) if files.has_key(dep_filename): if Options["debug"]: @@ -183,16 +184,16 @@ def check_changes (filename): # Move to the pool directory cwd = os.getcwd() - file = files.keys()[0] - pool_dir = Cnf["Dir::Pool"] + '/' + utils.poolify(changes["source"], files[file]["component"]) + f = files.keys()[0] + pool_dir = Cnf["Dir::Pool"] + '/' + utils.poolify(changes["source"], files[f]["component"]) os.chdir(pool_dir) changes_result = 0 - for file in files.keys(): - if file.endswith(".deb"): - result = check_package(file, files) + for f in files.keys(): + if f.endswith(".deb"): + result = check_package(f, files) if Options["verbose"]: - pass_fail(file, result) + pass_fail(f, result) changes_result += result pass_fail (filename, changes_result) @@ -210,12 +211,12 @@ def check_deb (filename): ################################################################################ def check_joey (filename): - file = utils.open_file(filename) + f = utils.open_file(filename) cwd = os.getcwd() os.chdir("%s/dists/proposed-updates" % (Cnf["Dir::Root"])) - for line in file.readlines(): + for line in f.readlines(): line = line.rstrip() if line.find('install') != -1: split_line = line.split() @@ -228,7 +229,7 @@ def check_joey (filename): if Options["debug"]: print "Processing %s..." % (changes_filename) check_changes(changes_filename) - file.close() + f.close() os.chdir(cwd) @@ -274,8 +275,8 @@ def main (): ('v',"verbose","Check-Proposed-Updates::Options::Verbose"), ('h',"help","Check-Proposed-Updates::Options::Help")] for i in [ "debug", "quiet", "verbose", "help" ]: - if not Cnf.has_key("Check-Proposed-Updates::Options::%s" % (i)): - Cnf["Check-Proposed-Updates::Options::%s" % (i)] = "" + if not Cnf.has_key("Check-Proposed-Updates::Options::%s" % (i)): + Cnf["Check-Proposed-Updates::Options::%s" % (i)] = "" arguments = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv) Options = Cnf.SubTree("Check-Proposed-Updates::Options") @@ -292,15 +293,15 @@ def main (): parse_packages() print "done." - for file in arguments: - if file.endswith(".changes"): - check_changes(file) - elif file.endswith(".deb"): - check_deb(file) - elif file.endswith(".joey"): - check_joey(file) + for f in arguments: + if f.endswith(".changes"): + check_changes(f) + elif f.endswith(".deb"): + check_deb(f) + elif f.endswith(".joey"): + check_joey(f) else: - utils.fubar("Unrecognised file type: '%s'." % (file)) + utils.fubar("Unrecognised file type: '%s'." % (f)) #######################################################################################