- std::vector<std::string>::const_iterator pi;
- for (pi =ConfigurationFile::GetInstance().Get_package_paths().begin();
- pi!=ConfigurationFile::GetInstance().Get_package_paths().end();
- ++pi)
- package_paths.push_back(*pi);
+ if (name[0] != '.' && name[0] != '/' && name[1]!= ':')
+ {
+ bbtkError("Use absolute or relative path name! ["<<name<<"] is an illegal name");
+ return;
+ }
+
+ // std::string path = Utilities::ExpandLibName(upath, verbose);
+ std::string path = Utilities::ExpandLibName(name, verbose); // keep last item, here.
+ if (path != "")
+ {
+ std::string p2;
+ Utilities::ExtractPackageName(path,p2);
+ //libname = Utilities::MakeLibnameFromPath(path, pkgname);
+ libname = Utilities::MakeLibnameFromPath(p2, pkgname); // remove last item
+ // Check if library exists
+ if ( !Utilities::FileExists(libname) )
+ {
+ // The following is *NOT* a debug time message :
+ // It's a user intended message.
+ // Please don't remove it.
+ if (verbose)
+ std::cout <<" [" <<libname <<"] : doesn't exist" <<std::endl;
+ }
+ else
+ {
+ ok = DoLoadPackage( libname, pkgname, path, verbose);
+ }
+ }
+ else
+ {
+ bbtkError("Path ["<<upath<<"] doesn't exist");
+ return;
+ }