From 6d67a5a8a4134a92423ec319105f468fc1f24ce3 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 23 Apr 2023 21:12:04 -0700 Subject: [PATCH] Add a command line option to specify package search directories --- source/cli/buildercli.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/cli/buildercli.cpp b/source/cli/buildercli.cpp index 5741fa6..cfd367c 100644 --- a/source/cli/buildercli.cpp +++ b/source/cli/buildercli.cpp @@ -29,6 +29,7 @@ BuilderCLI::BuilderCLI(int argc, char **argv): bool silent = false; vector log_channels; string build_type; + vector package_path; GetOpt getopt; getopt.add_option('a', "analyze", analyze_mode, GetOpt::REQUIRED_ARG).set_help("Perform dependency analysis.", "MODE"); @@ -46,6 +47,7 @@ BuilderCLI::BuilderCLI(int argc, char **argv): getopt.add_option('A', "conf-all", conf_all, GetOpt::NO_ARG).set_help("Apply configuration to all packages."); getopt.add_option('B', "build-all", build_all, GetOpt::NO_ARG).set_help("Build all targets unconditionally."); getopt.add_option('C', "chdir", work_dir, GetOpt::REQUIRED_ARG).set_help("Change to DIR before doing anything else.", "DIR"); + getopt.add_option('I', "package-dir",package_path, GetOpt::REQUIRED_ARG).set_help("Additional directory containing packages.", "DIR"); getopt.add_option('P', "progress", show_progress, GetOpt::NO_ARG).set_help("Display progress while building."); getopt.add_option('W', "what-if", what_if, GetOpt::REQUIRED_ARG).set_help("Pretend that FILE has changed.", "FILE"); getopt.add_option( "arch", arch, GetOpt::REQUIRED_ARG).set_help("Build for architecture ARCH.", "ARCH"); @@ -119,6 +121,8 @@ BuilderCLI::BuilderCLI(int argc, char **argv): package_manager.append_package_path(cwd); package_manager.append_package_path(cwd/".."); + for(const string &p: package_path) + package_manager.append_package_path(cwd/p); package_manager.append_binary_package_path(FS::get_sys_data_dir()/"packages"); package_manager.set_no_externals(no_externals); -- 2.45.2