pkg_path.push_back(p);
}
+void PackageManager::append_binary_package_path(const FS::Path &p)
+{
+ binpkg_path.push_back(p);
+}
+
void PackageManager::set_no_externals(bool x)
{
no_externals = x;
}
}
+ FS::Path path = get_binary_package_file(name);
+ if(!path.empty())
+ {
+ builder.load_build_file(path);
+ i = packages.find(name);
+ if(i!=packages.end())
+ return i->second;
+ }
+
Package *pkg = 0;
try
{
return FS::Path();
}
+
+FS::Path PackageManager::get_binary_package_file(const string &name)
+{
+ builder.get_logger().log("packagemgr", format("Looking for binary package %s", name));
+
+ if(binpkg_files.empty())
+ {
+ for(list<FS::Path>::const_iterator i=binpkg_path.begin(); i!=binpkg_path.end(); ++i)
+ {
+ builder.get_logger().log("files", format("Traversing %s", *i));
+ list<string> files = list_filtered(*i, "\\.bpk$");
+ for(list<string>::const_iterator j=files.begin(); j!=files.end(); ++j)
+ binpkg_files.push_back(*i / *j);
+ builder.get_logger().log("packagemgr", format("%d binary packages found in %s", files.size(), *i));
+ }
+
+ builder.get_logger().log("packagemgr", format("%d binary packages found", binpkg_files.size()));
+ }
+
+ for(SearchPath::const_iterator i=binpkg_files.begin(); i!=binpkg_files.end(); ++i)
+ {
+ string base = FS::basepart(FS::basename(*i));
+ if(base==name)
+ return *i;
+ }
+
+ return FS::Path();
+}