From 907972ec30eb8dfdc6dd5d00655eb557b92a4d0d Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Mon, 24 Oct 2016 16:54:51 +0200 Subject: [PATCH] e2-ls-project: fix and add two options --chroot shows all chroot groups --env shows the result environment Signed-off-by: Tobias Ulmer --- doc/man/e2-ls-project.1.in | 12 +++++++++--- local/e2-ls-project.lua | 17 +++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/doc/man/e2-ls-project.1.in b/doc/man/e2-ls-project.1.in index 8c88dbd..eabe0a9 100644 --- a/doc/man/e2-ls-project.1.in +++ b/doc/man/e2-ls-project.1.in @@ -1,8 +1,8 @@ .\" Man page for e2-ls-project .\" -.\" (c)2007, 2012 emlix GmbH +.\" (c)2007-2016 emlix GmbH .\" -.TH e2-ls-project 1 "Oct 16, 2012" "@VERSION@" +.TH e2-ls-project 1 "@VERSION@" .SH NAME e2-ls-project \- show project information of an e2factory project @@ -35,6 +35,12 @@ As "\-\-dot", but also show sources. .BR \-\-swap Swaps the direction of the graphs. .TP +.BR \-\-chroot +Also show chroot groups. +.TP +.BR \-\-env +Also show env variables. +.TP For further global options, see \fBe2factory\fR(1). .TP .BR \-\-check @@ -56,4 +62,4 @@ e2-ls-project --dot | dot -Tpdf > project.pdf .BR e2factory (1) .SH COPYRIGHT -(c)2013 emlix GmbH +(c)2007-2016 emlix GmbH diff --git a/local/e2-ls-project.lua b/local/e2-ls-project.lua index 1b43919..d5e8139 100644 --- a/local/e2-ls-project.lua +++ b/local/e2-ls-project.lua @@ -48,6 +48,8 @@ local function e2_ls_project(arg) e2option.flag("dot-sources", "generate dot(1) graph with sources included") e2option.flag("swap", "swap arrow directions in dot graph") e2option.flag("all", "show unused results and sources, too") + e2option.flag("chroot", "show chroot groups as well") + e2option.flag("env", "show environment vars as well") local opts, arguments = e2option.parse(arg) if not opts then @@ -96,12 +98,10 @@ local function e2_ls_project(arg) for _, resultname in pairs(results) do local res = result.results[resultname] - if res:isInstanceOf(result.result_class) then - for sourcename in res:sources_list():iter_sorted() do - if not yet[sourcename] then - table.insert(sources, sourcename) - yet[sourcename] = true - end + for sourcename in res:sources_list():iter_sorted() do + if not yet[sourcename] then + table.insert(sources, sourcename) + yet[sourcename] = true end end end @@ -182,7 +182,7 @@ local function e2_ls_project(arg) else console.infof(" \"%s\"\n", r) end - if opts["dot-sources"] and res:isInstanceOf(result.result_class) then + if opts["dot-sources"] then for src in res:sources_list():iter_sorted() do if opts.swap then console.infof(" \"%s-src\" %s \"%s\"\n", src, arrow, r) @@ -273,7 +273,8 @@ local function e2_ls_project(arg) s2 = "|" end - for _,at in ipairs(res:attribute_table({env = true, chroot=true})) do + local flagt = { env = opts.env, chroot = opts.chroot } + for _,at in ipairs(res:attribute_table(flagt)) do p3(s1, s2, unpack(at)) end end -- 2.39.5