]> git.tdb.fi Git - builder.git/commitdiff
Feed paths to PackageManager from the outside
authorMikko Rasa <tdb@tdb.fi>
Sun, 22 Jul 2012 14:47:36 +0000 (17:47 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 22 Jul 2012 14:48:20 +0000 (17:48 +0300)
source/builder.cpp
source/packagemanager.cpp
source/packagemanager.h

index d598a9f5cb2caa8bc6e5f8d238bdaad9c0ddd86a..b8b035066b5f286eedeb84c8e904fdd88930ed8f 100644 (file)
@@ -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())
index 4d4228279d62e6b8de5c8571b02dfb69bd60d1b1..86047bfa76ae1140e462f54ac082a6149143880e 100644 (file)
@@ -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;
index 4017065d83299de2d0c880f5d6a61b8139343f6a..9ae93c9829b9ade57911e1f514a0c9c2fe25893b 100644 (file)
@@ -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);