# Create all the Release files
# Copyright (C) 2001 Anthony Towns <ajt@debian.org>
-# $Id: ziyi,v 1.6 2001-05-05 07:20:57 ajt 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
################################################################################
+def usage (exit_code=0):
+ print """Usage: ziyi [OPTION]
+Generate Release files.
+
+ -h, --help show this help and exit"""
+
+ sys.exit(exit_code)
+
+################################################################################
+
def compressnames (tree,type,file):
compress = AptCnf.get("%s::%s::Compress" % (tree,type), AptCnf.get("Default::%s::Compress" % (type), ". gzip"))
result = []
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:
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:
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())
- print "APT.CONF IS: " + utils.which_apt_conf_file()
- Arguments = [('d',"debug","Ziyi::Options::Debug", "IntVal"),
- ('h',"help","Ziyi::Options::Help"),
- ('v',"version","Ziyi::Options::Version")]
+ Arguments = [('h',"help","Ziyi::Options::Help")];
+ for i in [ "help" ]:
+ 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")
+
+ if Options["Help"]:
+ usage();
- if suites == []:
+ if not suites:
suites = Cnf.SubTree("Suite").List()
def real_arch(x):
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
dest = Cnf["Dir::RootDir"] + tree + "/Release.gpg"
if os.path.exists(dest):
os.unlink(dest)
- os.system("gpg --secret-keyring \"%s\" --no-options --batch --no-tty --armour --detach-sign <%s --output=%s" % (Cnf["Dinstall::SigningKeyring"],
+ os.system("gpg --secret-keyring \"%s\" --no-options --batch --no-tty --armour --detach-sign <%s --output=%s" % (Cnf["Dinstall::SigningKeyring"],
Cnf["Dir::RootDir"] + tree + "/Release", dest))
#######################################################################################