From 5384724d937196e1e3f5c15fe443c0bff07896e6 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 19 Aug 2019 23:39:38 +0300 Subject: Make testscripts to ignore user's default options files --- bpkg/bpkg.cxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'bpkg/bpkg.cxx') diff --git a/bpkg/bpkg.cxx b/bpkg/bpkg.cxx index 0da8c58..170a7fe 100644 --- a/bpkg/bpkg.cxx +++ b/bpkg/bpkg.cxx @@ -95,7 +95,7 @@ namespace bpkg return default_options_files { {path ("bpkg.options"), path (string ("bpkg-") + cmd + ".options")}, - nullopt /* start_dir */}; + nullopt /* start */}; } // Merge the default options and the command line options. Fail if options @@ -234,15 +234,25 @@ init (const common_options& co, if (!o.no_default_options ()) // Command line option. try { + bpkg::optional extra; + if (o.default_options_specified ()) + extra = o.default_options (); + o = merge_options ( load_default_options ( nullopt /* sys_dir */, path::home_directory (), + extra, options_files (cmd, o, args), - [&trace, &verbosity] (const path& f, bool remote) + [&trace, &verbosity] (const path& f, bool r, bool o) { if (verbosity () >= 3) - trace << "loading " << (remote ? "remote " : "local ") << f; + { + if (o) + trace << "treating " << f << " as " << (r ? "remote" : "local"); + else + trace << "loading " << (r ? "remote " : "local ") << f; + } }), o); } -- cgit v1.1