X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fpoolize.py;h=ef41d7421198835f78c516d5ed09d230f2910bc4;hb=be43b7027584f24eb1faa6275553d96f91e4e6c7;hp=1a445eab0d3ea7b093ea2d1942ff93913c977f86;hpb=e2ae71066cbb134753d7bfceb16e87d0b76dfd6e;p=dak.git diff --git a/dak/poolize.py b/dak/poolize.py index 1a445eab..ef41d742 100755 --- a/dak/poolize.py +++ b/dak/poolize.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Poolify (move packages from "legacy" type locations to pool locations) +""" Poolify (move packages from "legacy" type locations to pool locations) """ # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006 James Troup # This program is free software; you can redistribute it and/or modify @@ -29,14 +29,13 @@ import os, pg, re, stat, sys import apt_pkg, apt_inst import daklib.database import daklib.utils +from daklib.regexes import re_isadeb, re_extract_src_version, re_no_epoch, re_issource ################################################################################ Cnf = None projectB = None -re_isadeb = re.compile (r"(.+?)_(.+?)(_(.+))?\.u?deb$") - ################################################################################ def usage (exit_code=0): @@ -84,17 +83,17 @@ def poolize (q, limit, verbose, no_action): package = control.Find("Package", "") source = control.Find("Source", package) if source.find("(") != -1: - m = daklib.utils.re_extract_src_version.match(source) + m = re_extract_src_version.match(source) source = m.group(1) # If it's a binary, we need to also rename the file to include the architecture version = control.Find("Version", "") architecture = control.Find("Architecture", "") if package == "" or version == "" or architecture == "": daklib.utils.fubar("%s: couldn't determine required information to rename .deb file." % (legacy_filename)) - version = daklib.utils.re_no_epoch.sub('', version) + version = re_no_epoch.sub('', version) destination_filename = "%s_%s_%s.deb" % (package, version, architecture) else: - m = daklib.utils.re_issource.match(base_filename) + m = re_issource.match(base_filename) if m: source = m.group(1) else: @@ -141,8 +140,8 @@ def main (): Cnf = daklib.utils.get_conf() for i in ["help", "limit", "no-action", "verbose" ]: - if not Cnf.has_key("Poolize::Options::%s" % (i)): - Cnf["Poolize::Options::%s" % (i)] = "" + if not Cnf.has_key("Poolize::Options::%s" % (i)): + Cnf["Poolize::Options::%s" % (i)] = "" Arguments = [('h',"help","Poolize::Options::Help"), @@ -190,4 +189,3 @@ UNION SELECT l.path, f.filename, f.id as files_id, null as component if __name__ == '__main__': main() -