]> Creatis software - bbtk.git/blobdiff - kernel/appli/bbPlugPackage/bbPlugPackage.cpp
#3521 Init output ButtonSelectFilesDirectory
[bbtk.git] / kernel / appli / bbPlugPackage / bbPlugPackage.cpp
index 6dbe260ceee2145ecebf4050db9175c7c8ba0509..ed0d026862dfed5f301a58c785f6649ec4a6f1fe 100644 (file)
@@ -41,25 +41,41 @@ int main(int argc, char **argv)
       return (int)1;
     }
 
-  std::string path(argv[1]);
-  std::string fname = path + "/bbtkPackage"; 
-
+  std::string path = argv[1] ;
+  #ifdef WIN32
+  std::string fname = path + "\\bbtkPackage"; 
+  #else
+  std::string fname = path + "/bbtkPackage" ;
+  #endif
+  
   if ( ! Utilities::FileExists( fname ) )
     {
-      std::cout << "* ERROR : The directory '"<<path<<"' does not contain a 'bbtkPackage' file"        << std::endl;
+      std::cout << "* ERROR : The directory '"<< path <<" ' does not contain a 'bbtkPackage' file" << std::endl;
       return (int)2; 
+
     }
        
   std::ifstream f;
   f.open(fname.c_str());
   std::string pname;
   f >> pname;
+  while(pname[0] == '#')
+  {
+    getline(f, pname, '\n');
+    f >> pname;
+  }
+    
   f.close();
   
-  
+  std::cout << "executing   update file: bbtk_config.xml " << std::endl;
   ConfigurationFile::GetInstance().AddPackagePathsAndWrite( path );
   
   std::string command;
+    
+#ifdef __APPLE__
+        command = "source ~/.bashrc ; " + command;
+#endif
+
 #if defined(WIN32)
        command = "\"";
 #endif
@@ -70,17 +86,20 @@ int main(int argc, char **argv)
   command += "\"";
 #endif
   command += " " + pname + " -q";
-
-if ( system ( command.c_str() ) )
- {
-    std::cout << "An error occured while running '" 
-               << command << "'" << std::endl;
-     // return 1; Feature #1676 - DFGO
-  }
-
-        
+  std::cout << "(SKIP EED) executing '" << command << "'" << std::endl;
+//if ( system ( command.c_str() ) )
+// {
+//    std::cout << "An error occured while running '"
+//             << command << "'" << std::endl;
+//     // return 1; Feature #1676 - DFGO
+//  }
 
   command = "";
+    
+#ifdef __APPLE__
+        command = "source ~/.bashrc ; " + command;
+#endif
+
 #if defined(WIN32)
   command = "\"";
 #endif
@@ -91,18 +110,18 @@ if ( system ( command.c_str() ) )
   command += "\"";
 #endif
   command += " -q";
-  if ( ! system ( command.c_str() ) )
-    {
-      std::cout << "Package '" 
-               << pname << "' successfully plugged in" << std::endl;
-    }
-  else 
-    {
-      std::cout << "An error occured while running '" 
-               << command << "'" << std::endl;
-      //return 1; Feature #1676 - DFGO
-    }
+ std::cout << "(SKIP EED) executing '" << command << "'" << std::endl;
+    
+//  if ( ! system ( command.c_str() ) )
+//    {
+//      std::cout << "Package '"
+//             << pname << "' successfully plugged in" << std::endl;
+//    } else {
+//      std::cout << "An error occured while running '"
+//             << command << "'" << std::endl;
+//      //return 1; Feature #1676 - DFGO
+//    }
+    
   return (int)0;
 }
 //==========================================================================