From 854c668b5e63e26a9d7a6e55226a0940638e0453 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 9 Feb 2023 15:46:32 +0200 Subject: Add pkg-bindist command (generate binary distribution package) This commit includes an implementation for Debian and alike. --- bpkg/utility.cxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'bpkg/utility.cxx') 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) { -- cgit v1.1