# Poolify (move packages from "legacy" type locations to pool locations)
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: catherine,v 1.10 2001-06-22 22:53:14 troup Exp $
+# $Id: catherine,v 1.11 2001-09-27 01:22:51 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
Cnf = None;
projectB = None;
+################################################################################
+
+def usage (exit_code=0):
+ print """Usage: catherine [OPTIONS]
+Migrate packages from legacy locations into the pool.
+
+ -l, --limit=AMOUNT only migrate AMOUNT Kb of packages
+ -n, --no-action don't do anything
+ -v, --verbose explain what is being done
+ -h, --help show this help and exit"""
+
+ sys.exit(exit_code)
+
+################################################################################
+
# Q is a python-postgresql query result set and must have the
# following four columns:
# o files.id (as 'files_id')
q = projectB.query("UPDATE files SET filename = '%s', location = '%s' WHERE id = '%s'" % (pool_filename, location_id, qid["files_id"]));
sys.stderr.write("Poolized %s in %s files.\n" % (utils.size_type(poolized_size), poolized_count));
-
+
################################################################################
def main ():
global Cnf, projectB;
apt_pkg.init();
-
+
Cnf = apt_pkg.newConfiguration();
apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
- Arguments = [('D',"debug","Catherine::Options::Debug", "IntVal"),
- ('h',"help","Catherine::Options::Help"),
- ('V',"version","Catherine::Options::Version"),
+ Arguments = [('h',"help","Catherine::Options::Help"),
('l',"limit", "Catherine::Options::Limit", "HasArg"),
('n',"no-action","Catherine::Options::No-Action"),
('v',"verbose","Catherine::Options::Verbose")];
+ for i in ["help", "limit", "no-action", "verose" ]:
+ Cnf["Catherine::Options::%s" % (i)] = "";
apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
Options = Cnf.SubTree("Catherine::Options")
+ if Options["Help"]:
+ usage();
+
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]));
db_access.init(Cnf, projectB);
# Grab a list of all files not already in the pool
q = projectB.query("""
-SELECT l.path, f.filename, f.id as files_id, c.name as component
- FROM files f, location l, component c WHERE
- NOT EXISTS (SELECT * FROM location l WHERE l.type = 'pool' AND f.location = l.id)
- AND NOT (f.filename ~ '^potato') AND f.location = l.id AND l.component = c.id
+SELECT l.path, f.filename, f.id as files_id, c.name as component
+ FROM files f, location l, component c WHERE
+ NOT EXISTS (SELECT * FROM location l WHERE l.type = 'pool' AND f.location = l.id)
+ AND NOT (f.filename ~ '^potato') AND f.location = l.id AND l.component = c.id
UNION SELECT l.path, f.filename, f.id as files_id, null as component
- FROM files f, location l WHERE
- NOT EXISTS (SELECT * FROM location l WHERE l.type = 'pool' AND f.location = l.id)
- AND NOT (f.filename ~ '^potato') AND f.location = l.id AND NOT EXISTS
+ FROM files f, location l WHERE
+ NOT EXISTS (SELECT * FROM location l WHERE l.type = 'pool' AND f.location = l.id)
+ AND NOT (f.filename ~ '^potato') AND f.location = l.id AND NOT EXISTS
(SELECT l.path FROM location l WHERE l.component IS NOT NULL AND f.location = l.id);""");
poolize(q, limit, Options["Verbose"], Options["No-Action"]);
# 'Fix' stable to make debian-cd and dpkg -BORGiE users happy
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: claire.py,v 1.7 2001-04-03 10:02:16 troup Exp $
+# $Id: claire.py,v 1.8 2001-09-27 01:22:51 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
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+################################################################################
+
# "Look around... leaves are brown... and the sky's a hazy shade of winter,
# Look around... leaves are brown... there's a patch of snow on the ground."
# -- Simon & Garfunkel / 'A Hazy Shade'
################################################################################
+def usage (exit_code=0):
+ print """Usage: claire [OPTIONS]
+Create compatability symlinks from legacy locations to the pool.
+
+ -v, --verbose explain what is being done
+ -h, --help show this help and exit"""
+
+ sys.exit(exit_code)
+
+################################################################################
+
# Relativize an absolute symlink from 'src' -> 'dest' relative to 'root'.
# Returns fixed 'src'
def clean_symlink (src, dest, root):
os.symlink(src, dest);
dislocated_files[i[4]] = dest;
- #return dislocated_files;
-
- # TODO later when there's something to test it with!
# Binary
q = projectB.query("""
SELECT DISTINCT ON (f.id) c.name, a.arch_string, sec.section, b.package,
package = i[3]
version = utils.re_no_epoch.sub('', i[4]);
src = i[5]+i[6]
-
+
dest = "%sdists/%s/%s/binary-%s/%s%s_%s.deb" % (Cnf["Dir::RootDir"], Cnf.get("Suite::Stable::CodeName", "stable"), component, architecture, section, package, version);
src = clean_symlink(src, dest, Cnf["Dir::RootDir"]);
if not os.path.exists(dest):
global Cnf, projectB;
apt_pkg.init();
-
+
Cnf = apt_pkg.newConfiguration();
apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
- Arguments = [('d',"debug","Claire::Options::Debug", "IntVal"),
- ('h',"help","Claire::Options::Help"),
- ('v',"verbose","Claire::Options::Verbose"),
- ('V',"version","Claire::Options::Version")];
+ Arguments = [('h',"help","Claire::Options::Help"),
+ ('v',"verbose","Claire::Options::Verbose")];
+ for i in ["help", "verbose" ]:
+ Cnf["Claire::Options::%s" % (i)] = "";
apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
+ Options = Cnf.SubTree("Claire::Options")
+
+ if Options["Help"]:
+ usage();
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]));
# Script to automate some parts of checking NEW packages
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: fernanda,v 1.2 2001-06-22 22:53:14 troup Exp $
+# $Id: fernanda,v 1.3 2001-09-27 01:22:51 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
################################################################################
+def usage (exit_code=0):
+ print """Usage: fernanda [PACKAGE]...
+Check NEW package(s).
+
+ -h, --help show this help and exit
+
+PACKAGE can be a .changes, .dsc, .deb or .udeb filename."""
+
+ sys.exit(exit_code)
+
+################################################################################
+
def do_command (command, filename):
o = os.popen("%s %s" % (command, filename));
print o.read();
print "---- control file for %s ----" % (filename);
do_command ("dpkg -I", deb_filename);
-
+
if is_a_udeb:
print "---- skipping lintian check for µdeb ----";
print ;
def check_changes (changes_filename):
changes = utils.parse_changes (changes_filename, 0);
-
+
print "---- .changes file for %s ----" % (changes_filename);
file = utils.open_file (changes_filename, 'r');
for line in file.readlines():
print line[:-1]
print ;
file.close();
-
+
files = utils.build_file_list(changes, "");
-
+
for file in files.keys():
if file[-4:] == ".deb" or file[-5:] == ".udeb":
check_deb(file);
global Cnf, projectB, db_files, waste, excluded;
apt_pkg.init();
-
+
Cnf = apt_pkg.newConfiguration();
apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
- Arguments = [('D',"debug","Jennifer::Options::Debug", "IntVal"),
- ('h',"help","Jennifer::Options::Help"),
- ('v',"version","Jennifer::Options::Version")];
+ Arguments = [('h',"help","Fernanda::Options::Help")];
+ for i in [ "help" ]:
+ Cnf["Fernanda::Options::%s" % (i)] = "";
args = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
+ Options = Cnf.SubTree("Fernanda::Options")
+
+ if Options["Help"]:
+ usage();
+
stdout_fd = sys.stdout;
-
+
for file in args:
try:
# Pipe output for each argument through less
# Manipulate suite tags
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: heidi,v 1.8 2001-09-14 17:16:18 troup Exp $
+# $Id: heidi,v 1.9 2001-09-27 01:22:51 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
projectB = None;
Logger = None;
+################################################################################
+
+def usage (exit_code=0):
+ print """Usage: heidi [OPTIONS] [FILE]
+Display or alter the contents of a suite using FILE(s), or stdin.
+
+ -a, --add=SUITE add to SUITE
+ -l, --list=SUITE list the contents of SUITE
+ -r, --remove=SUITE remove from SUITE
+ -s, --set=SUITE set SUITE
+ -h, --help show this help and exit"""
+
+ sys.exit(exit_code)
+
#######################################################################################
def get_id (package, version, architecture):
apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
Arguments = [('a',"add","Heidi::Options::Add", "HasArg"),
- ('D',"debug","Heidi::Options::Debug", "IntVal"),
('h',"help","Heidi::Options::Help"),
('l',"list","Heidi::Options::List","HasArg"),
('r',"remove", "Heidi::Options::Remove", "HasArg"),
- ('s',"set", "Heidi::Options::Set", "HasArg"),
- ('V',"version","Heidi::Options::Version")];
+ ('s',"set", "Heidi::Options::Set", "HasArg")];
+
+ for i in ["add", "help", "list", "remove", "set", "version" ]:
+ Cnf["Heidi::Options::%s" % (i)] = "";
file_list = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
+ Options = Cnf.SubTree("Heidi::Options")
+
+ if Options["Help"]:
+ usage();
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"],int(Cnf["DB::Port"]));
# Generate file list which is then fed to apt-ftparchive to generate Packages and Sources files
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: jenna,v 1.13 2001-08-21 15:47:47 troup Exp $
+# $Id: jenna,v 1.14 2001-09-27 01:22:51 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
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#######################################################################################
+################################################################################
# BTAF: "GOD *DAMMIT*!! What the FUCK happened to my free will??"
#
# -- http://www.angryflower.com/timelo.gif
-#######################################################################################
+################################################################################
import pg, string, os, sys
import apt_pkg
import db_access, utils, claire, logging
+################################################################################
+
projectB = None
Cnf = None
Logger = None;
+################################################################################
+
+def usage (exit_code=0):
+ print """Usage: jenna [OPTION]
+Write out file lists suitable for use with apt-ftparchive.
+
+ -a, --architecture=ARCH only write file lists for this architecture
+ -c, --component=COMPONENT only write file lists for this component
+ -s, --suite=SUITE only write file lists for this suite
+ -h, --help show this help and exit
+
+ARCH, COMPONENT and SUITE can be space seperated lists, e.g.
+ --architecture=\"m68k i386\""""
+ sys.exit(exit_code)
+
+################################################################################
+
def generate_src_list(suite, component, output, dislocated_files):
sources = {}
Arguments = [('a',"architecture","Jenna::Options::Architecture", "HasArg"),
('c',"component","Jenna::Options::Component", "HasArg"),
- ('d',"debug","Jenna::Options::Debug", "IntVal"),
('h',"help","Jenna::Options::Help"),
- ('s',"suite", "Jenna::Options::Suite", "HasArg"),
- ('v',"verbose","Jenna::Options::Verbose"),
- ('V',"version","Jenna::Options::Version")];
+ ('s',"suite", "Jenna::Options::Suite", "HasArg")];
+
+ for i in ["architecture", "component", "help", "suite" ]:
+ Cnf["Jenna::Options::%s" % (i)] = "";
apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
+ Options = Cnf.SubTree("Jenna::Options");
+
+ if Options["Help"]:
+ usage();
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]));
db_access.init(Cnf, projectB);
Logger = logging.Logger(Cnf, "jenna");
- if Cnf["Jenna::Options::Suite"] == "":
- Cnf["Jenna::Options::Suite"] = string.join(Cnf.SubTree("Suite").List());
- for suite in string.split(Cnf["Jenna::Options::Suite"]):
+ if Options["Suite"] == "":
+ Options["Suite"] = string.join(Cnf.SubTree("Suite").List());
+ for suite in string.split(Options["Suite"]):
suite = string.lower(suite);
if suite == 'stable':
dislocated_files = claire.find_dislocated_stable(Cnf, projectB);
dislocated_files = {};
clean_suite(suite);
clean_duplicate_packages(suite)
- components = Cnf["Jenna::Options::Component"];
+ components = Options["Component"];
if not Cnf.has_key("Suite::%s::Components" % (suite)):
components = "-";
if components == "":
components = string.join(Cnf.SubTree("Suite::%s::Components" % (suite)).List());
for component in string.split(components):
component = string.lower(component)
- architectures = Cnf["Jenna::Options::Architecture"];
+ architectures = Options["Architecture"];
if architectures == "":
architectures = string.join(Cnf.SubTree("Suite::%s::Architectures" % (suite)).List());
for architecture in string.split(architectures):
# Clean incoming of old unused files
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: shania,v 1.5 2001-06-23 00:25:52 troup Exp $
+# $Id: shania,v 1.6 2001-09-27 01:22:51 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
import apt_pkg;
################################################################################
-
+
# 23:12|<aj> I will not hush!
# 23:12|<elmo> :>
# 23:12|<aj> Where there is injustice in the world, I shall be there!
################################################################################
+def usage (exit_code=0):
+ print """Usage: shania [OPTIONS]
+Clean out incoming directories.
+
+ -d, --days=DAYS remove anything older than DAYS old
+ -i, --incoming=INCOMING the incoming directory to clean
+ -n, --no-action don't do anything
+ -v, --verbose explain what is being done
+ -h, --help show this help and exit"""
+
+ sys.exit(exit_code)
+
+################################################################################
+
def init ():
global delete_date, del_dir;
-
+
delete_date = int(time.time())-(int(Options["Days"])*84600);
# Ensure a directory exists to remove files to
utils.move(file, dest_filename);
else:
utils.warn("skipping '%s', permission denied." % (os.path.basename(file)));
-
+
# Removes any old files.
# [Used for Incoming/REJECT]
#
def flush_orphans ():
all_files = {};
changes_files = [];
-
+
# Build up the list of all files in the directory
for i in os.listdir('.'):
if os.path.isfile(i):
if Options["Verbose"]:
print "Skipping, has parents, '%s'." % (key);
del all_files[key];
-
+
# Anthing left at this stage is not referenced by a .changes (or
# a .dsc) and should be deleted if old enough.
for file in all_files.keys():
else:
if Options["Verbose"]:
print "Skipping, too new, '%s'." % (os.path.basename(file));
-
+
+################################################################################
+
def main ():
global Cnf, Options;
-
+
apt_pkg.init();
-
+
Cnf = apt_pkg.newConfiguration();
apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
- Arguments = [('D',"debug","Shania::Options::Debug", "IntVal"),
- ('h',"help","Shania::Options::Help"),
- ('V',"version","Shania::Options::Version"),
+ Arguments = [('h',"help","Shania::Options::Help"),
('d',"days","Shania::Options::Days", "IntVal"),
('i',"incoming","Shania::Options::Incoming", "HasArg"),
('n',"no-action","Shania::Options::No-Action"),
('v',"verbose","Shania::Options::Verbose")];
+ for i in ["help", "days", "incoming", "no-action", "verbose" ]:
+ Cnf["Shania::Options::%s" % (i)] = "";
apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
Options = Cnf.SubTree("Shania::Options")
+ if Options["Help"]:
+ usage();
+
init ();
if Options["Verbose"]:
# Create all the Release files
# Copyright (C) 2001 Anthony Towns <ajt@debian.org>
-# $Id: ziyi,v 1.7 2001-08-21 15:40:10 troup Exp $
+# $Id: ziyi,v 1.8 2001-09-27 01:22:51 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
################################################################################
+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 = []
AptCnf = apt_pkg.newConfiguration()
apt_pkg.ReadConfigFileISC(AptCnf,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" ]:
+ Cnf["Ziyi::Options::%s" % (i)] = "";
suites = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv)
+ Options = Cnf.SubTree("Ziyi::Options")
+
+ if Options["Help"]:
+ usage();
if suites == []:
suites = Cnf.SubTree("Suite").List()