3 # Dump variables from a .katie file to stdout
4 # Copyright (C) 2001 James Troup <james@nocrew.org>
5 # $Id: ashley,v 1.3 2002-04-20 13:13:00 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[-6:] == ".katie":
29 arg = arg[:-6]+".katie";
30 if arg[-8:] != ".changes":
31 utils.warn("Skipping '%s', unknown file type." % (arg));
33 k.pkg.changes_file = arg;
38 changes = k.pkg.changes;
40 # Mandatory changes fields
41 for i in [ "source", "version", "maintainer", "urgency", "changedby822", "changedbyname", "maintainername", "maintaineremail", "fingerprint" ]:
42 print " %s: %s" % (string.capitalize(i), changes[i]);
44 # Mandatory changes lists
45 for i in [ "distribution", "architecture", "closes" ]:
46 print " %s: %s" % (string.capitalize(i), string.join(changes[i].keys()));
48 # Optional changes fields
49 for i in [ "changed-by", "maintainer822", "filecontents", "format" ]:
50 if changes.has_key(i):
51 print " %s: %s" % (string.capitalize(i), changes[i]);
55 utils.warn("changes still has following unrecognised keys: %s" % (changes.keys()));
59 for i in [ "source", "version", "maintainer", "fingerprint", "uploaders" ]:
61 print " %s: %s" % (string.capitalize(i), dsc[i]);
65 utils.warn("dsc still has following unrecognised keys: %s" % (dsc.keys()));
69 for file in files.keys():
70 print " %s:" % (file);
71 for i in [ "package", "version", "architecture", "type", "size",
72 "md5sum", "component", "location id", "source package",
73 "source version", "maintainer", "dbtype", "files id",
74 "new", "section", "priority" ]:
75 if files[file].has_key(i):
76 print " %s: %s" % (string.capitalize(i), files[file][i]);
79 utils.warn("files[%s] still has following unrecognised keys: %s" % (file, files[file].keys()));
82 dsc_files = k.pkg.dsc_files;
84 for file in dsc_files.keys():
85 print " %s:" % (file);
87 for i in [ "size", "md5sum" ]:
88 print " %s: %s" % (string.capitalize(i), dsc_files[file][i]);
89 del dsc_files[file][i];
91 for i in [ "files id" ]:
92 if dsc_files[file].has_key(i):
93 print " %s: %s" % (string.capitalize(i), dsc_files[file][i]);
94 del dsc_files[file][i];
96 utils.warn("dsc_files[%s] still has following unrecognised keys: %s" % (file, dsc_files[file].keys()));
99 if __name__ == '__main__':