3 # Dump variables from a .katie file to stdout
4 # Copyright (C) 2001, 2002 James Troup <james@nocrew.org>
5 # $Id: ashley,v 1.8 2003-01-02 18:10:02 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
21 ################################################################################
23 # <elmo> ooooooooooooooohhhhhhhhhhhhhhhhhhhhhhhhh dddddddddeeeeeeeaaaaaaaarrrrrrrrrrr
24 # <elmo> iiiiiiiiiiiii tttttttttthhhhhhhhiiiiiiiiiiiinnnnnnnnnkkkkkkkkkkkkk iiiiiiiiiiiiii mmmmmmmmmmeeeeeeeesssssssssssssssseeeeeeeddd uuuupppppppppppp ttttttttthhhhhhhheeeeeeee xxxxxxxssssssseeeeeeeeettttttttttttt aaaaaaaarrrrrrrggggggsssssssss
26 # ['xset r rate 30 250' bad, mmkay]
28 ################################################################################
35 ################################################################################
37 def usage(exit_code=0):
38 print """Usage: ashley FILE...
39 Dumps the info in .katie FILE(s).
41 -h, --help show this help and exit."""
44 ################################################################################
47 Cnf = utils.get_conf()
48 Arguments = [('h',"help","Ashley::Options::Help")];
50 if not Cnf.has_key("Ashley::Options::%s" % (i)):
51 Cnf["Ashley::Options::%s" % (i)] = "";
53 apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv);
55 Options = Cnf.SubTree("Ashley::Options")
60 for arg in sys.argv[1:]:
61 arg = utils.validate_changes_file_arg(arg);
62 k.pkg.changes_file = arg;
67 changes = k.pkg.changes;
69 # Mandatory changes fields
70 for i in [ "source", "version", "maintainer", "urgency", "changedby822", "changedbyname", "maintainername", "maintaineremail", "fingerprint" ]:
71 print " %s: %s" % (i.capitalize(), changes[i]);
73 # Mandatory changes lists
74 for i in [ "distribution", "architecture", "closes" ]:
75 print " %s: %s" % (i.capitalize(), " ".join(changes[i].keys()));
77 # Optional changes fields
78 for i in [ "changed-by", "maintainer822", "filecontents", "format" ]:
79 if changes.has_key(i):
80 print " %s: %s" % (i.capitalize(), changes[i]);
84 utils.warn("changes still has following unrecognised keys: %s" % (changes.keys()));
88 for i in [ "source", "version", "maintainer", "fingerprint", "uploaders" ]:
90 print " %s: %s" % (i.capitalize(), dsc[i]);
94 utils.warn("dsc still has following unrecognised keys: %s" % (dsc.keys()));
98 for file in files.keys():
99 print " %s:" % (file);
100 for i in [ "package", "version", "architecture", "type", "size",
101 "md5sum", "component", "location id", "source package",
102 "source version", "maintainer", "dbtype", "files id",
103 "new", "section", "priority" ]:
104 if files[file].has_key(i):
105 print " %s: %s" % (i.capitalize(), files[file][i]);
108 utils.warn("files[%s] still has following unrecognised keys: %s" % (file, files[file].keys()));
111 dsc_files = k.pkg.dsc_files;
113 for file in dsc_files.keys():
114 print " %s:" % (file);
116 for i in [ "size", "md5sum" ]:
117 print " %s: %s" % (i.capitalize(), dsc_files[file][i]);
118 del dsc_files[file][i];
120 for i in [ "files id" ]:
121 if dsc_files[file].has_key(i):
122 print " %s: %s" % (i.capitalize(), dsc_files[file][i]);
123 del dsc_files[file][i];
125 utils.warn("dsc_files[%s] still has following unrecognised keys: %s" % (file, dsc_files[file].keys()));
127 ################################################################################
129 if __name__ == '__main__':