3 # Dump variables from a .katie file to stdout
4 # Copyright (C) 2001 James Troup <james@nocrew.org>
5 # $Id: ashley,v 1.2 2002-02-15 22:42:52 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 if arg[-8:] != ".changes":
29 utils.warn("Skipping '%s', unknown file type." % (arg));
31 k.pkg.changes_file = arg;
36 changes = k.pkg.changes;
38 # Mandatory changes fields
39 for i in [ "source", "version", "maintainer", "urgency", "changedby822", "changedbyname", "maintainername", "maintaineremail", "fingerprint" ]:
40 print " %s: %s" % (string.capitalize(i), changes[i]);
42 # Mandatory changes lists
43 for i in [ "distribution", "architecture", "closes" ]:
44 print " %s: %s" % (string.capitalize(i), string.join(changes[i].keys()));
46 # Optional changes fields
47 for i in [ "changed-by", "maintainer822", "filecontents", "format" ]:
48 if changes.has_key(i):
49 print " %s: %s" % (string.capitalize(i), changes[i]);
53 utils.warn("changes still has following unrecognised keys: %s" % (changes.keys()));
57 for i in [ "source", "version", "maintainer", "fingerprint", "uploaders" ]:
59 print " %s: %s" % (string.capitalize(i), dsc[i]);
63 utils.warn("dsc still has following unrecognised keys: %s" % (dsc.keys()));
67 for file in files.keys():
68 print " %s:" % (file);
69 for i in [ "package", "version", "architecture", "type", "size",
70 "md5sum", "component", "location id", "source package",
71 "source version", "maintainer", "dbtype", "files id",
72 "new", "section", "priority" ]:
73 if files[file].has_key(i):
74 print " %s: %s" % (string.capitalize(i), files[file][i]);
77 utils.warn("files[%s] still has following unrecognised keys: %s" % (file, files[file].keys()));
80 dsc_files = k.pkg.dsc_files;
82 for file in dsc_files.keys():
83 print " %s:" % (file);
85 for i in [ "size", "md5sum" ]:
86 print " %s: %s" % (string.capitalize(i), dsc_files[file][i]);
87 del dsc_files[file][i];
89 for i in [ "files id" ]:
90 if dsc_files[file].has_key(i):
91 print " %s: %s" % (string.capitalize(i), dsc_files[file][i]);
92 del dsc_files[file][i];
94 utils.warn("dsc_files[%s] still has following unrecognised keys: %s" % (file, dsc_files[file].keys()));
97 if __name__ == '__main__':