]> git.tdb.fi Git - builder.git/commitdiff
Don't try to look for Build files in non-directories
authorMikko Rasa <tdb@tdb.fi>
Sat, 6 May 2023 14:32:40 +0000 (17:32 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 6 May 2023 14:34:19 +0000 (17:34 +0300)
My stat implementation on Windows apparently treats this situation as
"file not found", so I did not notice it until now.

source/lib/packagemanager.cpp

index fb9a514573dc9c2b4e2ed20437e1a0efdf1f449b..6763aa78ef463556583eb540b514db52966ba863 100644 (file)
@@ -193,11 +193,14 @@ FS::Path PackageManager::get_package_location(const string &name)
                        for(const string &f: list_files(p))
                        {
                                FS::Path full = p/f;
-                               FS::Stat st = FS::stat(full/"Build");
-                               if(st && st.get_type()!=FS::DIRECTORY)
+                               if(FS::is_dir(full))
                                {
-                                       pkg_dirs.push_back(full);
-                                       ++count;
+                                       FS::Stat st = FS::stat(full/"Build");
+                                       if(st && st.get_type()!=FS::DIRECTORY)
+                                       {
+                                               pkg_dirs.push_back(full);
+                                               ++count;
+                                       }
                                }
                        }