aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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