aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-06-29 14:55:44 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-06-29 14:55:44 +0300
commit996aba4f0989de1fa2b8cf13ef482bf228bd410e (patch)
tree705c34fcdf9ccf3962c935834504134be7f8948e
parentd23063b1406c9bd1b688c6b658ce22c675173a2b (diff)
Add --sys-sudo options for sync and init commands
-rw-r--r--bdep/init.cli9
-rw-r--r--bdep/sync.cli9
-rw-r--r--bdep/sync.cxx3
-rw-r--r--bdep/sync.hxx6
4 files changed, 26 insertions, 1 deletions
diff --git a/bdep/init.cli b/bdep/init.cli
index 2bd41b1..f1b78f4 100644
--- a/bdep/init.cli
+++ b/bdep/init.cli
@@ -220,6 +220,15 @@ namespace bdep
See the corresponding \l{bpkg-pkg-build(1)} option for details."
}
+ string --sys-sudo = "sudo"
+ {
+ "<prog>",
+ "The \cb{sudo} program to use for system package manager interactions
+ that normally require administrative privileges (fetch package
+ metadata, install packages, etc). See the corresponding
+ \l{bpkg-pkg-build(1)} option for details."
+ }
+
bool --create-host-config
{
"Create a configuration for build-time dependencies without prompt (see
diff --git a/bdep/sync.cli b/bdep/sync.cli
index db567b3..bee9e29 100644
--- a/bdep/sync.cli
+++ b/bdep/sync.cli
@@ -259,6 +259,15 @@ namespace bdep
See the corresponding \l{bpkg-pkg-build(1)} option for details."
}
+ string --sys-sudo = "sudo"
+ {
+ "<prog>",
+ "The \cb{sudo} program to use for system package manager interactions
+ that normally require administrative privileges (fetch package
+ metadata, install packages, etc). See the corresponding
+ \l{bpkg-pkg-build(1)} option for details."
+ }
+
bool --create-host-config
{
"Create a configuration for build-time dependencies without prompt."
diff --git a/bdep/sync.cxx b/bdep/sync.cxx
index 4978169..45ee46c 100644
--- a/bdep/sync.cxx
+++ b/bdep/sync.cxx
@@ -1714,6 +1714,9 @@ namespace bdep
(so.no_fetch ? "--sys-no-fetch" : nullptr),
(so.no_stub ? "--sys-no-stub" : nullptr),
(so.yes ? "--sys-yes" : nullptr),
+ (so.sudo
+ ? cstrings ({"--sys-sudo", so.sudo->c_str ()})
+ : cstrings ()),
args));
// Shouldn't throw, unless something is severely damaged.
diff --git a/bdep/sync.hxx b/bdep/sync.hxx
index f370ae3..9003836 100644
--- a/bdep/sync.hxx
+++ b/bdep/sync.hxx
@@ -66,6 +66,7 @@ namespace bdep
bool no_fetch = false;
bool no_stub = false;
bool yes = false;
+ optional<string> sudo;
sys_options () = default;
@@ -76,7 +77,10 @@ namespace bdep
install (o.sys_install ()),
no_fetch (o.sys_no_fetch ()),
no_stub (o.sys_no_stub ()),
- yes (o.sys_yes ()) {}
+ yes (o.sys_yes ()),
+ sudo (o.sys_sudo_specified ()
+ ? o.sys_sudo ()
+ : optional<string> ()) {}
};
synced_configs_guard