diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-02-09 15:46:32 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-03-09 12:31:18 +0200 |
commit | 854c668b5e63e26a9d7a6e55226a0940638e0453 (patch) | |
tree | 86b03f5db9d65c925941fc872aaa76d24248e0d3 /bpkg/utility.cxx | |
parent | eaebfcff492cf7f707b44a3d28620e786116faf1 (diff) |
Add pkg-bindist command (generate binary distribution package)
This commit includes an implementation for Debian and alike.
Diffstat (limited to 'bpkg/utility.cxx')
-rw-r--r-- | bpkg/utility.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bpkg/utility.cxx b/bpkg/utility.cxx index b79c85b..96fda0f 100644 --- a/bpkg/utility.cxx +++ b/bpkg/utility.cxx @@ -369,6 +369,26 @@ namespace bpkg : BPKG_EXE_PREFIX "b" BPKG_EXE_SUFFIX; } + process_path + search_b (const common_options& co) + { + const char* b (name_b (co)); + + try + { + // Use our executable directory as a fallback search since normally the + // entire toolchain is installed into one directory. This way, for + // example, if we installed into /opt/build2 and run bpkg with absolute + // path (and without PATH), then bpkg will be able to find "its" b. + // + return process::path_search (b, exec_dir); + } + catch (const process_error& e) + { + fail << "unable to execute " << b << ": " << e << endf; + } + } + void dump_stderr (auto_fd&& fd) { |