From 4028cea1dcbe00e018f9fbafac5cc5a174ee6649 Mon Sep 17 00:00:00 2001 From: Gordon Hecker Date: Wed, 16 Dec 2009 13:45:18 +0100 Subject: [PATCH] local tools: finish command line handling before setting up the project structure Signed-off-by: Gordon Hecker --- local/build-numbers.lua | 10 +++++----- local/build.lua | 12 +++++++----- local/playground.lua | 10 +++++----- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/local/build-numbers.lua b/local/build-numbers.lua index 60f6c6d..10936e4 100755 --- a/local/build-numbers.lua +++ b/local/build-numbers.lua @@ -39,6 +39,11 @@ policy.register_commandline_options() e2option.flag("no-sync", "do not synchronize with the server") local opts = e2option.parse(arg) +-- get build mode from the command line +local build_mode = policy.handle_commandline_options(opts, true) +if not build_mode then + e2lib.abort("no build mode given") +end local info, re = e2tool.collect_project_info() if not info then e2lib.abort(re) @@ -48,11 +53,6 @@ if not rc then e2lib.abort(re) end --- get build mode from the command line -local build_mode = policy.handle_commandline_options(opts, true) -if not build_mode then - e2lib.abort("no build mode given") -end -- apply the standard build mode to all results for _,res in pairs(info.results) do res.build_mode = build_mode diff --git a/local/build.lua b/local/build.lua index 177da3c..c3febeb 100755 --- a/local/build.lua +++ b/local/build.lua @@ -47,6 +47,13 @@ e2option.flag("buildnumber", "use real build numbers") e2option.flag("buildid", "display buildids and exit") local opts = e2option.parse(arg) + +-- get build mode from the command line +local build_mode = policy.handle_commandline_options(opts, true) +if not build_mode then + e2lib.abort("no build mode given") +end + local info, re = e2tool.collect_project_info() if not info then e2lib.abort(re) @@ -58,11 +65,6 @@ end e2lib.log_invocation(info, arg) --- get build mode from the command line -local build_mode = policy.handle_commandline_options(opts, true) -if not build_mode then - e2lib.abort("no build mode given") -end -- apply the standard build mode to all results for _,res in pairs(info.results) do res.build_mode = build_mode diff --git a/local/playground.lua b/local/playground.lua index 01c854c..e4e1d8a 100644 --- a/local/playground.lua +++ b/local/playground.lua @@ -43,6 +43,11 @@ e2option.flag("runinit","run init files automatically") e2option.flag("showpath", "prints the path of the build directory inside the chroot to stdout" ) local opts = e2option.parse(arg) +-- get build mode from the command line +local build_mode = policy.handle_commandline_options(opts, true) +if not build_mode then + e2lib.abort("no build mode given") +end local info, re = e2tool.collect_project_info() if not info then e2lib.abort(re) @@ -60,11 +65,6 @@ end r = opts.arguments[1] --- get build mode from the command line -local build_mode = policy.handle_commandline_options(opts, true) -if not build_mode then - e2lib.abort("no build mode given") -end -- apply the standard build mode to all results for _,res in pairs(info.results) do res.build_mode = build_mode -- 2.39.5