X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fpoolize.py;h=ef41d7421198835f78c516d5ed09d230f2910bc4;hb=74c5a1256401a709d74c496b972cc0bd38decaa8;hp=5b7ffbf64b2cdaf82b11cbb33436104e40b573cb;hpb=d9822f04453a1b62ca0aa66e2efeea35f654778f;p=dak.git diff --git a/dak/poolize.py b/dak/poolize.py old mode 100644 new mode 100755 index 5b7ffbf6..ef41d742 --- 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: