]> git.tdb.fi Git - builder.git/blobdiff - source/lib/packagemanager.cpp
Make PackageManager::run_pkgconfig fail on Windows
[builder.git] / source / lib / packagemanager.cpp
index 37374b6ef05ea6e8c18ad5c7c92f868db8dee0bb..7bf546837472d2ec152c0afad9bb261fa77644ee 100644 (file)
@@ -1,5 +1,6 @@
 #include <cstdlib>
 #include <msp/core/algorithm.h>
+#include <msp/core/except.h>
 #include <msp/fs/dir.h>
 #include <msp/fs/stat.h>
 #include <msp/fs/utils.h>
@@ -160,7 +161,7 @@ string PackageManager::run_pkgconfig(const string &pkg, const string &what)
 #else
        (void)pkg;
        (void)what;
-       return string();
+       throw unsupported("run_pkgconfig");
 #endif
 }
 
@@ -182,6 +183,9 @@ FS::Path PackageManager::get_package_location(const string &name)
        {
                for(const FS::Path &p: pkg_path)
                {
+                       if(!FS::exists(p))
+                               continue;
+
                        builder.get_logger().log("files", "Traversing %s", p);
                        unsigned count = 0;
                        for(const string &f: list_files(p))
@@ -223,6 +227,9 @@ FS::Path PackageManager::get_binary_package_file(const string &name)
        {
                for(const FS::Path &p: binpkg_path)
                {
+                       if(!FS::exists(p))
+                               continue;
+
                        builder.get_logger().log("files", "Traversing %s", p);
                        vector<string> files = list_filtered(p, "\\.bpk$");
                        for(const string &f: files)