aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-09-19 13:13:05 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-09-19 13:13:05 +0200
commite3154f3b02a61eb51f84c0911396687cb62b333e (patch)
treebf3af4772a5017a445cb5d200af2f878df16bd00
parent6737797c36ad1657f32bd074c38f7948858051cc (diff)
Add `none` value to bpkg-pkg-bindist --recursive option
-rw-r--r--bpkg/pkg-bindist.cli6
-rw-r--r--bpkg/pkg-bindist.cxx8
2 files changed, 8 insertions, 6 deletions
diff --git a/bpkg/pkg-bindist.cli b/bpkg/pkg-bindist.cli
index 2f30f6c..59a98f7 100644
--- a/bpkg/pkg-bindist.cli
+++ b/bpkg/pkg-bindist.cli
@@ -94,14 +94,16 @@ namespace bpkg
If unspecified, the host architecture is used."
}
- string --recursive
+ string --recursive = "none"
{
"<mode>",
"Bundle or generate dependencies of the specified packages. The <mode>
value can be either \cb{auto}, in which case only the required files
from each dependency package are bundled, \cb{full}, in which case
all the files are bundled, or \cb{separate}, in which case a separate
- binary package is generated for each non-system dependency.
+ binary package is generated for each non-system dependency. It can
+ also be \cb{none} which is equivalent to not specifying this option
+ (primarily useful for overriding a previously-specified value).
Specifically, in the \cb{auto} mode any required files, such as shared
libraries, are pulled implicitly by the \cb{install} build system
diff --git a/bpkg/pkg-bindist.cxx b/bpkg/pkg-bindist.cxx
index 5127f7e..4639746 100644
--- a/bpkg/pkg-bindist.cxx
+++ b/bpkg/pkg-bindist.cxx
@@ -237,7 +237,7 @@ namespace bpkg
if (m == "auto") rec = recursive_mode::auto_;
else if (m == "full") rec = recursive_mode::full;
else if (m == "separate") rec = recursive_mode::separate;
- else
+ else if (m != "none")
dr << fail << "unknown --recursive mode '" << m << "'";
}
@@ -579,9 +579,9 @@ namespace bpkg
{
json::stream_serializer s (cout);
- auto member = [&s] (const char* n, const string& v)
+ auto member = [&s] (const char* n, const string& v, const char* d = "")
{
- if (!v.empty ())
+ if (v != d)
s.member (n, v);
};
@@ -641,7 +641,7 @@ namespace bpkg
}
s.end_object (); // os_release
- member ("recursive", o.recursive ());
+ member ("recursive", o.recursive (), "none");
if (o.private_ ()) s.member ("private", true);
if (dependent_config) s.member ("dependent_config", true);