X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ashley;h=756ea5eb7caa1d779c7642a7d4a2865cea8de783;hb=d1bddedc641c0858a64a759ed91748fa2d7e8876;hp=1c4356424a8a3b6b963fb0ae87ea1a527c0e1378;hpb=ae70185cc6772c2a86edf03011e82e1fb267c147;p=dak.git diff --git a/ashley b/ashley index 1c435642..756ea5eb 100755 --- a/ashley +++ b/ashley @@ -2,7 +2,7 @@ # Dump variables from a .katie file to stdout # Copyright (C) 2001, 2002 James Troup -# $Id: ashley,v 1.6 2002-08-07 17:19:29 troup Exp $ +# $Id: ashley,v 1.8 2003-01-02 18:10:02 troup Exp $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,17 +21,41 @@ ################################################################################ # ooooooooooooooohhhhhhhhhhhhhhhhhhhhhhhhh dddddddddeeeeeeeaaaaaaaarrrrrrrrrrr -# iiiiiiiiiiiii tttttttttthhhhhhhhiiiiiiiiiiiinnnnnnnnnkkkkkkkkkkkkk iiiiiiiiiiiiii mmmmmmmmmmiiiiiiiisssssssssssssssseeeeeeeddd uuuupppppppppppp ttttttttthhhhhhhheeeeeeee xxxxxxxssssssseeeeeeeeettttttttttttt aaaaaaaarrrrrrrggggggsssssssss +# iiiiiiiiiiiii tttttttttthhhhhhhhiiiiiiiiiiiinnnnnnnnnkkkkkkkkkkkkk iiiiiiiiiiiiii mmmmmmmmmmeeeeeeeesssssssssssssssseeeeeeeddd uuuupppppppppppp ttttttttthhhhhhhheeeeeeee xxxxxxxssssssseeeeeeeeettttttttttttt aaaaaaaarrrrrrrggggggsssssssss # # ['xset r rate 30 250' bad, mmkay] ################################################################################ -import string, sys; +import sys; import katie, utils; +import apt_pkg; + + +################################################################################ + +def usage(exit_code=0): + print """Usage: ashley FILE... +Dumps the info in .katie FILE(s). + + -h, --help show this help and exit.""" + sys.exit(exit_code) + +################################################################################ def main(): Cnf = utils.get_conf() + Arguments = [('h',"help","Ashley::Options::Help")]; + for i in [ "help" ]: + if not Cnf.has_key("Ashley::Options::%s" % (i)): + Cnf["Ashley::Options::%s" % (i)] = ""; + + apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv); + + Options = Cnf.SubTree("Ashley::Options") + if Options["Help"]: + usage(); + k = katie.Katie(Cnf); for arg in sys.argv[1:]: arg = utils.validate_changes_file_arg(arg); @@ -44,16 +68,16 @@ def main(): print " Changes:"; # Mandatory changes fields for i in [ "source", "version", "maintainer", "urgency", "changedby822", "changedbyname", "maintainername", "maintaineremail", "fingerprint" ]: - print " %s: %s" % (string.capitalize(i), changes[i]); + print " %s: %s" % (i.capitalize(), changes[i]); del changes[i]; # Mandatory changes lists for i in [ "distribution", "architecture", "closes" ]: - print " %s: %s" % (string.capitalize(i), string.join(changes[i].keys())); + print " %s: %s" % (i.capitalize(), " ".join(changes[i].keys())); del changes[i]; # Optional changes fields for i in [ "changed-by", "maintainer822", "filecontents", "format" ]: if changes.has_key(i): - print " %s: %s" % (string.capitalize(i), changes[i]); + print " %s: %s" % (i.capitalize(), changes[i]); del changes[i]; print; if changes: @@ -63,7 +87,7 @@ def main(): print " Dsc:"; for i in [ "source", "version", "maintainer", "fingerprint", "uploaders" ]: if dsc.has_key(i): - print " %s: %s" % (string.capitalize(i), dsc[i]); + print " %s: %s" % (i.capitalize(), dsc[i]); del dsc[i]; print; if dsc: @@ -78,7 +102,7 @@ def main(): "source version", "maintainer", "dbtype", "files id", "new", "section", "priority" ]: if files[file].has_key(i): - print " %s: %s" % (string.capitalize(i), files[file][i]); + print " %s: %s" % (i.capitalize(), files[file][i]); del files[file][i]; if files[file]: utils.warn("files[%s] still has following unrecognised keys: %s" % (file, files[file].keys())); @@ -90,16 +114,17 @@ def main(): print " %s:" % (file); # Mandatory fields for i in [ "size", "md5sum" ]: - print " %s: %s" % (string.capitalize(i), dsc_files[file][i]); + print " %s: %s" % (i.capitalize(), dsc_files[file][i]); del dsc_files[file][i]; # Optional fields for i in [ "files id" ]: if dsc_files[file].has_key(i): - print " %s: %s" % (string.capitalize(i), dsc_files[file][i]); + print " %s: %s" % (i.capitalize(), dsc_files[file][i]); del dsc_files[file][i]; if dsc_files[file]: utils.warn("dsc_files[%s] still has following unrecognised keys: %s" % (file, dsc_files[file].keys())); +################################################################################ if __name__ == '__main__': main()