X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ziyi;h=81db8cdb1e257b900f648b99d6bb413f9ed86008;hb=b70a92c4d2ed83d2a801213a54718956c68d1655;hp=cd7033429cfef972396c5aa87529c58038d5a492;hpb=5fc7cefdb9b600c729ca5a82fd5b3a828f4fd370;p=dak.git diff --git a/ziyi b/ziyi index cd703342..81db8cdb 100755 --- a/ziyi +++ b/ziyi @@ -3,7 +3,7 @@ # Create all the Release files # Copyright (C) 2001 Anthony Towns -# $Id: ziyi,v 1.8 2001-09-27 01:22:51 troup Exp $ +# $Id: ziyi,v 1.10 2001-11-18 19:57:58 rmurray 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 @@ -60,7 +60,7 @@ def print_md5_files (tree, files): path = Cnf["Dir::RootDir"] + tree + "/" for name in files: try: - file_handle = utils.open_file(path + name, "r") + file_handle = utils.open_file(path + name) except utils.cant_open_exc: print "ALERT: Couldn't open " + path + name else: @@ -74,7 +74,7 @@ def print_sha1_files (tree, files): path = Cnf["Dir::RootDir"] + tree + "/" for name in files: try: - file_handle = utils.open_file(path + name, "r") + file_handle = utils.open_file(path + name) except utils.cant_open_exc: print "ALERT: Couldn't open " + path + name else: @@ -90,18 +90,15 @@ def main (): global Cnf, AptCnf, projectB, out out = sys.stdout; - - apt_pkg.init() - - Cnf = apt_pkg.newConfiguration() - apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file()) + Cnf = utils.get_conf() AptCnf = apt_pkg.newConfiguration() apt_pkg.ReadConfigFileISC(AptCnf,utils.which_apt_conf_file()) Arguments = [('h',"help","Ziyi::Options::Help")]; for i in [ "help" ]: - Cnf["Ziyi::Options::%s" % (i)] = ""; + if not Cnf.has_key("Ziyi::Options::%s" % (i)): + Cnf["Ziyi::Options::%s" % (i)] = ""; suites = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv) Options = Cnf.SubTree("Ziyi::Options") @@ -109,7 +106,7 @@ def main (): if Options["Help"]: usage(); - if suites == []: + if not suites: suites = Cnf.SubTree("Suite").List() def real_arch(x): @@ -143,7 +140,7 @@ def main (): nonus = 1 if components != []: for c in components: - if c[:7] != "non-US/": + if string.find(c, "non-US/") != 0: nonus = 0 else: nonus = 0