X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fdecode_dot_dak.py;h=7ea342bdb6818ed6649288c40ee46169489f2ced;hb=e79e9a1395528354b5978fc4b92a8fcdd1559d70;hp=51620ca9ed2e1798d9e445b81b0df58379edc3b9;hpb=30413cf0ff7bc21b8d2b8b4346406357fe55dc19;p=dak.git diff --git a/dak/decode_dot_dak.py b/dak/decode_dot_dak.py old mode 100755 new mode 100644 index 51620ca9..7ea342bd --- a/dak/decode_dot_dak.py +++ b/dak/decode_dot_dak.py @@ -1,8 +1,7 @@ #!/usr/bin/env python -# Dump variables from a .katie file to stdout -# Copyright (C) 2001, 2002, 2004 James Troup -# $Id: ashley,v 1.11 2004-11-27 16:05:12 troup Exp $ +# Dump variables from a .dak file to stdout +# Copyright (C) 2001, 2002, 2004, 2006 James Troup # 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 @@ -28,15 +27,15 @@ ################################################################################ import sys -import katie, utils import apt_pkg - +from daklib import queue +from daklib import utils ################################################################################ def usage(exit_code=0): - print """Usage: ashley FILE... -Dumps the info in .katie FILE(s). + print """Usage: dak decode-dot-dak FILE... +Dumps the info in .dak FILE(s). -h, --help show this help and exit.""" sys.exit(exit_code) @@ -45,23 +44,23 @@ Dumps the info in .katie FILE(s). def main(): Cnf = utils.get_conf() - Arguments = [('h',"help","Ashley::Options::Help")] + Arguments = [('h',"help","Decode-Dot-Dak::Options::Help")] for i in [ "help" ]: - if not Cnf.has_key("Ashley::Options::%s" % (i)): - Cnf["Ashley::Options::%s" % (i)] = "" + if not Cnf.has_key("Decode-Dot-Dak::Options::%s" % (i)): + Cnf["Decode-Dot-Dak::Options::%s" % (i)] = "" apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv) - Options = Cnf.SubTree("Ashley::Options") + Options = Cnf.SubTree("Decode-Dot-Dak::Options") if Options["Help"]: - usage() + usage() - k = katie.Katie(Cnf) + k = queue.Upload(Cnf) for arg in sys.argv[1:]: arg = utils.validate_changes_file_arg(arg,require_changes=-1) k.pkg.changes_file = arg print "%s:" % (arg) - k.init_vars() + k.init_vars() k.update_vars() changes = k.pkg.changes @@ -78,7 +77,7 @@ def main(): print " %s: %s" % (i.capitalize(), " ".join(changes[i].keys())) del changes[i] # Optional changes fields - for i in [ "changed-by", "filecontents", "format" ]: + for i in [ "changed-by", "filecontents", "format", "adv id" ]: if changes.has_key(i): print " %s: %s" % (i.capitalize(), changes[i]) del changes[i] @@ -99,37 +98,36 @@ def main(): files = k.pkg.files print " Files:" - for file in files.keys(): - print " %s:" % (file) + for f in files.keys(): + print " %s:" % (f) for i in [ "package", "version", "architecture", "type", "size", - "md5sum", "component", "location id", "source package", - "source version", "maintainer", "dbtype", "files id", - "new", "section", "priority", "pool name" ]: - if files[file].has_key(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())) + "md5sum", "sha1sum", "sha256sum", "component", "location id", + "source package", "source version", "maintainer", "dbtype", + "files id", "new", "section", "priority", "pool name" ]: + if files[f].has_key(i): + print " %s: %s" % (i.capitalize(), files[f][i]) + del files[f][i] + if files[f]: + utils.warn("files[%s] still has following unrecognised keys: %s" % (f, files[f].keys())) print dsc_files = k.pkg.dsc_files print " Dsc Files:" - for file in dsc_files.keys(): - print " %s:" % (file) + for f in dsc_files.keys(): + print " %s:" % (f) # Mandatory fields for i in [ "size", "md5sum" ]: - print " %s: %s" % (i.capitalize(), dsc_files[file][i]) - del dsc_files[file][i] + print " %s: %s" % (i.capitalize(), dsc_files[f][i]) + del dsc_files[f][i] # Optional fields for i in [ "files id" ]: - if dsc_files[file].has_key(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 dsc_files[f].has_key(i): + print " %s: %s" % (i.capitalize(), dsc_files[f][i]) + del dsc_files[f][i] + if dsc_files[f]: + utils.warn("dsc_files[%s] still has following unrecognised keys: %s" % (f, dsc_files[f].keys())) ################################################################################ if __name__ == '__main__': main() -