]> git.decadent.org.uk Git - dak.git/blobdiff - katie.py
2004-04-01 James Troup <james@nocrew.org> * utils.py (temp_filename): new helper...
[dak.git] / katie.py
index 197c6ec5b3848719f7c0e3652626ae23508d2eda..776310ddd73be779815dc93bfe721fbe01918b51 100644 (file)
--- a/katie.py
+++ b/katie.py
@@ -1,8 +1,8 @@
 #!/usr/bin/env python
 
 # Utility functions for katie
-# Copyright (C) 2001, 2002, 2003  James Troup <james@nocrew.org>
-# $Id: katie.py,v 1.41 2003-10-14 21:52:46 troup Exp $
+# Copyright (C) 2001, 2002, 2003, 2004  James Troup <james@nocrew.org>
+# $Id: katie.py,v 1.44 2004-02-27 20:07:40 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
@@ -93,7 +93,6 @@ class Katie:
 
     def __init__(self, Cnf):
         self.Cnf = Cnf;
-        self.values = {};
         # Read in the group-maint override file
         self.nmu = nmu_p(Cnf);
         self.accept_count = 0;
@@ -263,7 +262,7 @@ class Katie:
                 if files[file]["type"] == "deb":
                     summary += apt_pkg.ParseSection(apt_inst.debExtractControl(utils.open_file(file)))["Description"] + '\n';
             else:
-                files[file]["pool name"] = utils.poolify (changes["source"], files[file]["component"])
+                files[file]["pool name"] = utils.poolify (changes.get("source",""), files[file]["component"])
                 destination = self.Cnf["Dir::PoolRoot"] + files[file]["pool name"] + file
                 summary += file + "\n  to " + destination + "\n"
 
@@ -469,7 +468,9 @@ distribution.""";
             return;
 
         summary = "";
-        for file in files.keys():
+        file_keys = files.keys();
+        file_keys.sort();
+        for file in file_keys:
             if not files[file].has_key("new") and files[file]["type"] == "deb":
                 section = files[file]["section"];
                 override_section = files[file]["override section"];
@@ -644,17 +645,17 @@ distribution.""";
             ql = map(lambda x: x[0], q.getresult());
 
             # Try (1)
-            if ql.count(source_version):
+            if source_version in ql:
                 continue
 
             # Try (2)
             orig_source_version = re_bin_only_nmu_of_mu.sub('', source_version)
-            if ql.count(orig_source_version):
+            if orig_source_version in ql:
                 continue
 
             # Try (3)
             orig_source_version = re_bin_only_nmu_of_nmu.sub('', source_version)
-            if ql.count(orig_source_version):
+            if orig_source_version in ql:
                 continue
 
             # No source found...