From: Mikko Rasa Date: Sun, 22 Jul 2012 14:47:36 +0000 (+0300) Subject: Feed paths to PackageManager from the outside X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=a261f895c42dedb1a1fa1f03934ad9895d3f648c;p=builder.git Feed paths to PackageManager from the outside --- 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);