#!/usr/bin/env python
# Poolify (move packages from "legacy" type locations to pool locations)
-# Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup <james@nocrew.org>
-# $Id: catherine,v 1.19 2004-03-11 00:20:51 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
################################################################################
import os, pg, re, stat, sys
-import utils, db_access
import apt_pkg, apt_inst
+import dak.lib.database as database
+import dak.lib.utils as utils
################################################################################
################################################################################
def usage (exit_code=0):
- print """Usage: catherine [OPTIONS]
+ print """Usage: dak poolize [OPTIONS]
Migrate packages from legacy locations into the pool.
-l, --limit=AMOUNT only migrate AMOUNT Kb of packages
Cnf = utils.get_conf()
for i in ["help", "limit", "no-action", "verbose" ]:
- if not Cnf.has_key("Catherine::Options::%s" % (i)):
- Cnf["Catherine::Options::%s" % (i)] = ""
+ if not Cnf.has_key("Poolize::Options::%s" % (i)):
+ Cnf["Poolize::Options::%s" % (i)] = ""
- Arguments = [('h',"help","Catherine::Options::Help"),
- ('l',"limit", "Catherine::Options::Limit", "HasArg"),
- ('n',"no-action","Catherine::Options::No-Action"),
- ('v',"verbose","Catherine::Options::Verbose")]
+ Arguments = [('h',"help","Poolize::Options::Help"),
+ ('l',"limit", "Poolize::Options::Limit", "HasArg"),
+ ('n',"no-action","Poolize::Options::No-Action"),
+ ('v',"verbose","Poolize::Options::Verbose")]
apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv)
- Options = Cnf.SubTree("Catherine::Options")
+ Options = Cnf.SubTree("Poolize::Options")
if Options["Help"]:
usage()
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]))
- db_access.init(Cnf, projectB)
+ database.init(Cnf, projectB)
if not Options["Limit"]:
limit = -1