#!/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 <james@nocrew.org>
# This program is free software; you can redistribute it and/or modify
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):
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:
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"),
if __name__ == '__main__':
main()
-