#!/usr/bin/env python
# Poolify (move packages from "legacy" type locations to pool locations)
-# Copyright (C) 2000, 2001, 2002, 2003 James Troup <james@nocrew.org>
-# $Id: catherine,v 1.18 2003-09-07 13:52:50 troup Exp $
+# 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 $
# 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
base_filename = os.path.basename(legacy_filename);
destination_filename = base_filename;
# Work out the source package name
- if re_isadeb.match(base_filename) != None:
+ if re_isadeb.match(base_filename):
control = apt_pkg.ParseSection(apt_inst.debExtractControl(utils.open_file(legacy_filename)))
package = control.Find("Package", "");
source = control.Find("Source", package);
destination_filename = "%s_%s_%s.deb" % (package, version, architecture);
else:
m = utils.re_issource.match(base_filename)
- if m != None:
+ if m:
source = m.group(1);
else:
utils.fubar("expansion of source filename '%s' failed." % (legacy_filename));