X-Git-Url: http://dolda2000.com/gitweb/?p=tpkg.git;a=blobdiff_plain;f=tpkg;h=319d2482b831d51c8ef2a921863dedcc4904e053;hp=140ed2f4fe182e6387c5447e9c5d70f8419dcba5;hb=215990533d5eccc9e8a8b571114ea6e1925b4900;hpb=82bfc891550525b31563adfca69115586ed19540 diff --git a/tpkg b/tpkg index 140ed2f..319d248 100755 --- a/tpkg +++ b/tpkg @@ -318,6 +318,23 @@ def cmd_uninstall(argv): uninstall(prefix.use, pkgname) cmds["uninstall"] = cmd_uninstall +def cmd_list(argv): + def usage(out): + out.write("usage: tpkg list NAME\n") + opts, args = getopt.getopt(argv, "") + if len(args) < 1: + usage(sys.stderr) + sys.exit(1) + pkgname = args[0] + try: + files = prefix.use.pkgfiles(pkgname) + except KeyError: + sys.stderr.write("tpkg: %s: no such package\n" % (pkgname)) + sys.exit(1) + for fn in files: + sys.stdout.write("%s\n" % pj(prefix.use.root, fn)) +cmds["list"] = cmd_list + def usage(file): file.write("usage:\ttpkg help\n") cmds["help"] = lambda argv: usage(sys.stdout)