From a261f895c42dedb1a1fa1f03934ad9895d3f648c Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 22 Jul 2012 17:47:36 +0300 Subject: [PATCH] Feed paths to PackageManager from the outside --- source/builder.cpp | 3 +++ source/packagemanager.cpp | 10 ++++++---- source/packagemanager.h | 3 +++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/source/builder.cpp b/source/builder.cpp index d598a9f..b8b0350 100644 --- a/source/builder.cpp +++ b/source/builder.cpp @@ -158,6 +158,9 @@ Builder::Builder(int argc, char **argv): cwd = FS::getcwd(); + package_manager.append_package_path(cwd); + package_manager.append_package_path(cwd/".."); + package_manager.set_no_externals(no_externals); if(arch.empty()) diff --git a/source/packagemanager.cpp b/source/packagemanager.cpp index 4d42282..86047bf 100644 --- a/source/packagemanager.cpp +++ b/source/packagemanager.cpp @@ -20,10 +20,7 @@ PackageManager::PackageManager(Builder &b): builder(b), no_externals(false), env_set(false) -{ - pkg_path.push_back(builder.get_work_directory()/"."); - pkg_path.push_back(builder.get_work_directory()/".."); -} +{ } PackageManager::~PackageManager() { @@ -31,6 +28,11 @@ PackageManager::~PackageManager() delete i->second; } +void PackageManager::append_package_path(const FS::Path &p) +{ + pkg_path.push_back(p); +} + void PackageManager::set_no_externals(bool x) { no_externals = x; diff --git a/source/packagemanager.h b/source/packagemanager.h index 4017065..9ae93c9 100644 --- a/source/packagemanager.h +++ b/source/packagemanager.h @@ -32,6 +32,9 @@ public: PackageManager(Builder &); ~PackageManager(); + /// Adds a location to look for source packages from. + void append_package_path(const Msp::FS::Path &); + /** Prevent creation of source packages. */ void set_no_externals(bool); -- 2.45.2