3 # Dump variables from a .katie file to stdout
4 # Copyright (C) 2001, 2002, 2004 James Troup <james@nocrew.org>
5 # $Id: ashley,v 1.11 2004-11-27 16:05:12 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,require_changes=-1);
62 k.pkg.changes_file = arg;
67 changes = k.pkg.changes;
69 # Mandatory changes fields
70 for i in [ "source", "version", "maintainer", "urgency", "changedby822",
71 "changedby2047", "changedbyname", "maintainer822",
72 "maintainer2047", "maintainername", "maintaineremail",
73 "fingerprint", "changes" ]:
74 print " %s: %s" % (i.capitalize(), changes[i]);
76 # Mandatory changes lists
77 for i in [ "distribution", "architecture", "closes" ]:
78 print " %s: %s" % (i.capitalize(), " ".join(changes[i].keys()));
80 # Optional changes fields
81 for i in [ "changed-by", "filecontents", "format" ]:
82 if changes.has_key(i):
83 print " %s: %s" % (i.capitalize(), changes[i]);
87 utils.warn("changes still has following unrecognised keys: %s" % (changes.keys()));
91 for i in [ "source", "version", "maintainer", "fingerprint", "uploaders",
94 print " %s: %s" % (i.capitalize(), dsc[i]);
98 utils.warn("dsc still has following unrecognised keys: %s" % (dsc.keys()));
102 for file in files.keys():
103 print " %s:" % (file);
104 for i in [ "package", "version", "architecture", "type", "size",
105 "md5sum", "component", "location id", "source package",
106 "source version", "maintainer", "dbtype", "files id",
107 "new", "section", "priority", "pool name" ]:
108 if files[file].has_key(i):
109 print " %s: %s" % (i.capitalize(), files[file][i]);
112 utils.warn("files[%s] still has following unrecognised keys: %s" % (file, files[file].keys()));
115 dsc_files = k.pkg.dsc_files;
117 for file in dsc_files.keys():
118 print " %s:" % (file);
120 for i in [ "size", "md5sum" ]:
121 print " %s: %s" % (i.capitalize(), dsc_files[file][i]);
122 del dsc_files[file][i];
124 for i in [ "files id" ]:
125 if dsc_files[file].has_key(i):
126 print " %s: %s" % (i.capitalize(), dsc_files[file][i]);
127 del dsc_files[file][i];
129 utils.warn("dsc_files[%s] still has following unrecognised keys: %s" % (file, dsc_files[file].keys()));
131 ################################################################################
133 if __name__ == '__main__':