3 # Dump variables from a .katie file to stdout
4 # Copyright (C) 2001, 2002 James Troup <james@nocrew.org>
5 # $Id: ashley,v 1.5 2002-05-10 00:24:23 troup Exp $
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 Cnf = utils.get_conf()
27 for arg in sys.argv[1:]:
28 arg = utils.validate_changes_file_arg(arg);
29 k.pkg.changes_file = arg;
34 changes = k.pkg.changes;
36 # Mandatory changes fields
37 for i in [ "source", "version", "maintainer", "urgency", "changedby822", "changedbyname", "maintainername", "maintaineremail", "fingerprint" ]:
38 print " %s: %s" % (string.capitalize(i), changes[i]);
40 # Mandatory changes lists
41 for i in [ "distribution", "architecture", "closes" ]:
42 print " %s: %s" % (string.capitalize(i), string.join(changes[i].keys()));
44 # Optional changes fields
45 for i in [ "changed-by", "maintainer822", "filecontents", "format" ]:
46 if changes.has_key(i):
47 print " %s: %s" % (string.capitalize(i), changes[i]);
51 utils.warn("changes still has following unrecognised keys: %s" % (changes.keys()));
55 for i in [ "source", "version", "maintainer", "fingerprint", "uploaders" ]:
57 print " %s: %s" % (string.capitalize(i), dsc[i]);
61 utils.warn("dsc still has following unrecognised keys: %s" % (dsc.keys()));
65 for file in files.keys():
66 print " %s:" % (file);
67 for i in [ "package", "version", "architecture", "type", "size",
68 "md5sum", "component", "location id", "source package",
69 "source version", "maintainer", "dbtype", "files id",
70 "new", "section", "priority" ]:
71 if files[file].has_key(i):
72 print " %s: %s" % (string.capitalize(i), files[file][i]);
75 utils.warn("files[%s] still has following unrecognised keys: %s" % (file, files[file].keys()));
78 dsc_files = k.pkg.dsc_files;
80 for file in dsc_files.keys():
81 print " %s:" % (file);
83 for i in [ "size", "md5sum" ]:
84 print " %s: %s" % (string.capitalize(i), dsc_files[file][i]);
85 del dsc_files[file][i];
87 for i in [ "files id" ]:
88 if dsc_files[file].has_key(i):
89 print " %s: %s" % (string.capitalize(i), dsc_files[file][i]);
90 del dsc_files[file][i];
92 utils.warn("dsc_files[%s] still has following unrecognised keys: %s" % (file, dsc_files[file].keys()));
95 if __name__ == '__main__':