Salome HOME
1) update conserning using of universal binary package;
authorakl <akl@opencascade.com>
Fri, 9 Nov 2007 10:17:06 +0000 (10:17 +0000)
committerakl <akl@opencascade.com>
Fri, 9 Nov 2007 10:17:06 +0000 (10:17 +0000)
2) add 'Debian4.0' supporting;

bin/SALOME_InstallWizard
src/SALOME_InstallWizard.cxx
src/SALOME_InstallWizard.hxx

index 6047ba3f95c666b88bd4fff791ec3c228317bbb2..a6d292498c22ad5379b673b476a30f1f154338ac 100755 (executable)
Binary files a/bin/SALOME_InstallWizard and b/bin/SALOME_InstallWizard differ
index 3e593580cd576cda9c1776be539e55a35086e8ff..8372cca74a583367ef22d3c1179f8879a96fc283 100644 (file)
@@ -486,6 +486,9 @@ SALOME_InstallWizard::SALOME_InstallWizard(const QString& aXmlFileName,
   binPath = QDir::currentDirPath() + "/Products/BINARIES";
   srcPath = QDir::currentDirPath() + "/Products/SOURCES";
   
+  singleBinPlts << "Debian3.1" << "Mandriva2006.0_64" << "Debian4.0";
+  commonPlatform = "Debian3.1";
+  
   //
   // get XML filename and current platform
   //
@@ -511,7 +514,7 @@ SALOME_InstallWizard::SALOME_InstallWizard(const QString& aXmlFileName,
   addLogo( pixmap( pxLogo ) );
 
   // set defaults
-  setVersion( "3.2.7" );
+  setVersion( "4.0.0" );
   setCaption( tr( "SALOME %1" ).arg( myVersion ) );
   setCopyright( tr( "Copyright (C) 2007 CEA" ) );
   setLicense( tr( "All rights reserved." ) );
@@ -601,6 +604,21 @@ SALOME_InstallWizard::~SALOME_InstallWizard()
   delete myThread;
 }
 // ================================================================
+/*!
+ *  SALOME_InstallWizard::getBasePlatform
+ *  Determine the base platform for binaries installation
+ */
+// ================================================================
+QString SALOME_InstallWizard::getBasePlatform()
+{
+  QString aBasePlt = "";
+  if ( singleBinPlts.contains(curPlatform) )
+    aBasePlt = curPlatform;
+  else
+    aBasePlt = commonPlatform;
+  return aBasePlt;
+}
+// ================================================================
 /*!
  *  SALOME_InstallWizard::currentPlatform
  *  Tries to determine the current user's operating system
@@ -716,12 +734,12 @@ void SALOME_InstallWizard::getXmlAndPlatform()
     if ( !curPlatform.isEmpty() ) {
       // try to get XML file for current platform
       if ( xmlMap.find( curPlatform ) != xmlMap.end() ) {
-       xmlFileName = xmlMap[ curPlatform ];
-       QFileInfo fibp( QDir::cleanDirPath( getBinPath() + "/" + getPlatform() ) );
+       xmlFileName = xmlMap[ getBasePlatform() ];
+       QFileInfo fibp( QDir::cleanDirPath( getBinPath() + "/" + getBasePlatform() ) );
        if ( !fibp.isDir() ) {
-         platformsMap = xmlMap;
          warnMsg = tr( "Binaries are absent for current platform" );
        }
+       platformsMap = xmlMap;
       }
       else {
        platformsMap = xmlMap;
@@ -948,10 +966,6 @@ void SALOME_InstallWizard::setupTypePage()
 // ================================================================
 void SALOME_InstallWizard::setupPlatformPage()
 {
-  // create page or not?
-  if ( platformsMap.isEmpty() )
-    return;
-
   // create page
   platformsPage = new QWidget( this, "PlatformsPage" );
   QGridLayout* pageLayout = new QGridLayout( platformsPage );
@@ -962,13 +976,9 @@ void SALOME_InstallWizard::setupPlatformPage()
   QFont fnt = warnLab2->font();
   fnt.setBold( true );
   warnLab2->setFont( fnt );
-  if ( installType == Compile && platformsMap.find( curPlatform ) == platformsMap.end() )
-    warnMsg += tr( " and compilation is not tested on this one." );
-  else
-    warnMsg += ".";
   warnLab = new QLabel( warnMsg, platformsPage );
   warnLab->setAlignment( Qt::AlignHCenter | Qt::WordBreak );
-  QLabel* warnLab3 = new QLabel( tr( "If you want to proceed anyway, please select platform from the following list:" ), 
+  warnLab3 = new QLabel( tr( "If you want to proceed anyway, please select platform from the following list:" ), 
                                 platformsPage );
   warnLab3->setAlignment( Qt::AlignHCenter | Qt::WordBreak );
   // create button group
@@ -1356,6 +1366,7 @@ bool SALOME_InstallWizard::acceptData( const QString& pageTitle )
   QWidget* aPage = InstallWizard::page( pageTitle );
   if ( aPage == typePage ) {
     // installation type page
+    warnLab3->show();
     this->setAppropriate( platformsPage, false );
     if ( installType == Binaries ) { // 'Binary' installation type
       // check binaries directory
@@ -1370,9 +1381,29 @@ bool SALOME_InstallWizard::acceptData( const QString& pageTitle )
                              QMessageBox::NoButton );
        return false;
       }
-      QFileInfo fibp( QDir::cleanDirPath( getBinPath() + "/" + getPlatform() ) );
-      if ( !fibp.isDir() )
+      if ( platformsMap.find( curPlatform ) == platformsMap.end() ) {
+       // Unknown platform case
+       QString aMsg = warnMsg + tr( ".\nBy default the universal binary package will be installed." );
+       aMsg += tr( "\nIf you want to select another one, please use the following list:" );
+       warnLab->setText( aMsg );
+       warnLab3->hide();
        this->setAppropriate( platformsPage, true );
+      }
+      else {
+       // Supported platform case
+       QString aPlatform = curPlatform;
+       if ( curPlatform != getBasePlatform() ) {
+         refPlatform = getBasePlatform();
+         xmlFileName = platformsMap[ refPlatform ];
+         aPlatform = getPlatform();
+       }
+       QFileInfo fibp( QDir::cleanDirPath( getBinPath() + "/" + aPlatform ) );
+       if ( !fibp.isDir() ) {
+         warnLab->setText( tr( "Binaries are absent for current platform." ) );
+         this->setAppropriate( platformsPage, true );
+       }
+      }
+
       // check sources directory
       QFileInfo fis( QDir::cleanDirPath( getSrcPath() ) );
       if ( !fis.exists() )
@@ -1399,6 +1430,13 @@ bool SALOME_InstallWizard::acceptData( const QString& pageTitle )
                              QMessageBox::NoButton );
        return false;
       }
+      if ( platformsMap.find( curPlatform ) == platformsMap.end() ) {
+       QString aMsg = warnMsg + ".";
+       if ( installType == Compile )
+         aMsg = warnMsg + tr( " and compilation is not tested on this one." );
+       warnLab->setText( aMsg );
+       this->setAppropriate( platformsPage, true );
+      }
     }
   }
 
@@ -1893,16 +1931,16 @@ void SALOME_InstallWizard::launchScript()
     progressView->ensureVisible( prodProc );
     
     QCheckListItem* item;
-    if ( prodProc != "gcc" )
-      item = findItem( prodProc );
     // fill in script parameters
     shellProcess->clearArguments();
     // ... script name
     shellProcess->setWorkingDirectory( QDir::cleanDirPath( QFileInfo( "./config_files/" ).absFilePath() ) );
-    if ( prodProc != "gcc" )
+    if ( !extraProducts.contains( prodProc ) ) {
+      item = findItem( prodProc );
       shellProcess->addArgument( item->text(2) );
+    }
     else
-      shellProcess->addArgument( "gcc-common.sh" );
+      shellProcess->addArgument( extraProducts[ prodProc ] );
 
     // ... temp folder
     QString tmpFolder = QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME;
@@ -1910,7 +1948,7 @@ void SALOME_InstallWizard::launchScript()
     //  tmpFolder = "/tmp";
 
     // ... not install : try to find preinstalled
-    if ( !progressView->isVisible( prodProc ) ) {
+    if ( notInstall.contains( prodProc ) || prodProc == "gcc" ) {
       shellProcess->addArgument( "try_preinstalled" );
       shellProcess->addArgument( QFileInfo( tmpFolder ).absFilePath() );
       shellProcess->addArgument( QDir::currentDirPath() + "/Products" );
@@ -1940,14 +1978,14 @@ void SALOME_InstallWizard::launchScript()
     shellProcess->addArgument( QFileInfo( tgtFolder ).absFilePath() );
     // ... list of all products
     QString depproducts = DefineDependeces(productsMap);
-    depproducts.prepend( "gcc " );
+    depproducts.prepend( QStringList( extraProducts.keys() ).join(" ") + " " );
     ___MESSAGE___( "Dependancies"<< depproducts.latin1() );
     shellProcess->addArgument( depproducts );
     // ... product name - currently installed product
-    if ( prodProc != "gcc" )
+    if ( !extraProducts.contains( prodProc ) )
       shellProcess->addArgument( item->text(0) );
     else
-      shellProcess->addArgument( "gcc" );
+      shellProcess->addArgument( prodProc );
     // ... list of products being installed
     shellProcess->addArgument( prodSequence.join( " " ) );
     // ... sources directory
@@ -1972,7 +2010,7 @@ void SALOME_InstallWizard::launchScript()
   // all products are installed successfully
   MapProducts::Iterator mapIter;
   ___MESSAGE___( "starting pick-up environment" );
-  QString depproducts = QUOTE( DefineDependeces(productsMap).prepend( "gcc " ) );
+  QString depproducts = QUOTE( DefineDependeces(productsMap).prepend( QStringList( extraProducts.keys() ).join(" ") + " " ) );
   for ( mapIter = productsMap.begin(); mapIter != productsMap.end(); ++mapIter ) {
     QCheckListItem* item = mapIter.key();
     Dependancies dep = mapIter.data();
@@ -2294,6 +2332,8 @@ void SALOME_InstallWizard::pageChanged( const QString & mytitle)
        if ( installType == Binaries ) {
          QFileInfo fib( QDir::cleanDirPath( getBinPath() + "/" + plat ) );
          rb->setEnabled( fib.exists() );
+         if ( platBtnGrp->id( platBtnGrp->selected() ) == -1 && plat == getBasePlatform() )
+           rb->animateClick();
        }
        else {
          QFileInfo fis( QDir::cleanDirPath( getSrcPath() ) );
@@ -2340,6 +2380,11 @@ void SALOME_InstallWizard::pageChanged( const QString & mytitle)
       updateSizeColumn();
       rmSrcPrevState = removeSrcBtn->isChecked();
     }
+    // add extra products to install list
+    extraProducts.clear();
+    extraProducts.insert( "gcc", "gcc-common.sh" );
+    if ( refPlatform == commonPlatform && installType == Binaries )
+      extraProducts.insert( "DebianLibsForSalome", "DEBIANFORSALOME-3.1.sh" );
   }
   else if ( aPage == productsPage ) {
     // products page
@@ -2505,8 +2550,8 @@ void SALOME_InstallWizard::onStart()
   // clear lists of products
   toInstall.clear();
   notInstall.clear();
+  toInstall += extraProducts.keys();
   // ... and fill it for new process
-  toInstall.append( "gcc" );
   QCheckListItem* item = (QCheckListItem*)( prereqsView->firstChild() );
   while( item ) {
     if ( productsMap.contains( item ) ) {
@@ -2578,12 +2623,12 @@ void SALOME_InstallWizard::onStart()
     ProgressViewItem* progressItem;
     // set status for installed products
     for ( int i = 0; i < (int)toInstall.count(); i++ ) {
-      if ( toInstall[i] != "gcc" ) {
+      if ( !extraProducts.contains( toInstall[i] ) ) {
        item = findItem( toInstall[i] );
        progressView->addProduct( item->text(0), item->text(2) );
        continue;
       }
-      progressItem = progressView->addProduct( "gcc", "gcc-common.sh" );
+      progressItem = progressView->addProduct( toInstall[i], extraProducts[toInstall[i]] );
       progressItem->setVisible( false );
     }
     // set status for not installed products
@@ -2595,7 +2640,7 @@ void SALOME_InstallWizard::onStart()
     // get specified list of products being installed
     prodSequence.clear();
     for (int i = 0; i<(int)toInstall.count(); i++ ) {
-      if ( toInstall[i] == "gcc" ) {
+      if ( extraProducts.contains( toInstall[i] ) ) {
        prodSequence.append( toInstall[i] );
        continue;
       }
index f3564b4890b0509680a472d32bc7aab7b9383b16..7bc50b6c3150e7f37de8af73b3b57cd67475f947 100644 (file)
@@ -158,6 +158,8 @@ class SALOME_InstallWizard: public InstallWizard
   // destructor
   virtual ~SALOME_InstallWizard( );
 
+  // get base platform to install binaries package
+  QString getBasePlatform();
   // get current platform
   QString currentPlatform();
 
@@ -331,6 +333,7 @@ class SALOME_InstallWizard: public InstallWizard
   QProcess*        diskSpaceProc;  // shell process (to get available disk space script)
   QProcess*        checkFLibProc;  // shell process (to get available disk space script)
   MapProducts      productsMap;    // products info (name, dependancies, disk space )
+  MapXmlFiles      extraProducts;  // additional products to be installed
   QStringList      toInstall;      // list of products being installed
   QStringList      notInstall;     // list of products being not installed
   QStringList      prodSequence;   // specified list of products being installed
@@ -342,6 +345,8 @@ class SALOME_InstallWizard: public InstallWizard
   QString          xmlFileName;    // xml file
   QString          binPath;        // binaries path
   QString          srcPath;        // sources path
+  QString          commonPlatform; // platform with universal binaries
+  QStringList      singleBinPlts;  // list of platforms for that the special binary packages are exist
   bool             moreMode;       // advanced mode flag
   QWidget*         previousPage;   // previous page
   QString          tmpCreated;     // created temporary directory
@@ -368,6 +373,7 @@ class SALOME_InstallWizard: public InstallWizard
   QButtonGroup*    platBtnGrp;     // group of platforms for selection
   QString          warnMsg;        // warning message
   QLabel*          warnLab;        // warning label
+  QLabel*          warnLab3;       // additional warning label
   // --> installation directories page
   QWidget*         dirPage;        // page itself
   QLineEdit*       targetFolder;   // target directory for installing of products