From: vsr Date: Thu, 11 Nov 2004 13:00:52 +0000 (+0000) Subject: Add improvement (PAL7115): X-Git-Tag: before_merge_from_SALOME2~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b46a0a923b5a37fae80473b567c9f59232011dda;p=tools%2Finstall.git Add improvement (PAL7115): - when checking native products: if the version of product installed on the computer is newer than that is required, show warning message "Continue?" with two buttons "Yes", "No". --- diff --git a/config_files/gcc-3.2.sh b/config_files/gcc-3.2.sh index 0218684..e148073 100755 --- a/config_files/gcc-3.2.sh +++ b/config_files/gcc-3.2.sh @@ -1,7 +1,12 @@ #!/bin/sh check_version(){ -if [ `gcc --version | grep 'gcc (GCC) .*' | cut -b 11-13` == "3.2" ] ; then +gcc_ver=`gcc -dumpversion` +gcc_ver_number=`echo $gcc_ver | cut -d . -f 1` +gcc_ver_subnumber=`echo $gcc_ver | cut -d . -f 2` +gcc_ver=$(($gcc_ver_number*1000+$gcc_ver_subnumber)) +#if [ `gcc --version | grep 'gcc (GCC) .*' | cut -b 11-13` == "3.2" ] ; then +if [ $gcc_ver -eq 3002 ] ; then return 0 fi return 1 @@ -29,7 +34,12 @@ if [ -z "${gcc_root}" ] ; then fi if [ -n "${gcc_root}" ] ; then gcc_root=`cd ${gcc_root}/..; pwd` - if [ "`${gcc_root}/bin/gcc --version | grep 'gcc (GCC) .*' | cut -b 11-13`" = "3.2" ] ; then + gcc_ver=`gcc -dumpversion` + gcc_ver_number=`echo $gcc_ver | cut -d . -f 1` + gcc_ver_subnumber=`echo $gcc_ver | cut -d . -f 2` + gcc_ver=$(($gcc_ver_number*1000+$gcc_ver_subnumber)) + #if [ "`${gcc_root}/bin/gcc --version | grep 'gcc (GCC) .*' | cut -b 11-13`" = "3.2" ] ; then + if [ $gcc_ver -ge 3002 ] ; then tmp="\${GCC_ROOT}/bin ${gcc_root}/bin \${PATH} ${PATH}"; path=`sort_path ${tmp}` tmp="\${GCC_ROOT}/lib ${gcc_root}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}"; @@ -44,7 +54,11 @@ export LD_LIBRARY_PATH=${ld_library_path} ## EOF make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" - return 0 + if [ $gcc_ver -eq 3002 ] ; then + return 0 + else + return 2 + fi fi fi return 1 diff --git a/src/Makefile b/src/Makefile index b4dc32c..a51450e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: ../bin/SALOME_InstallWizard -# Generated by qmake (1.03a) on: Wed Mar 17 17:34:01 2004 +# Generated by qmake (1.03a) on: Wed Nov 10 19:38:39 2004 # Project: SALOME_INSTALL.pro # Template: app # Command: $(QMAKE) SALOME_INSTALL.pro @@ -12,14 +12,14 @@ CC = gcc CXX = g++ LEX = flex YACC = yacc -CFLAGS = -pipe -Wall -W -I/usr/include/fontconfig -I/usr/include/Xft2 -O2 -march=i386 -mcpu=i686 -fno-use-cxa-atexit -fno-exceptions -DQT_NO_DEBUG -CXXFLAGS = -pipe -Wall -W -I/usr/include/fontconfig -I/usr/include/Xft2 -O2 -march=i386 -mcpu=i686 -fno-use-cxa-atexit -fno-exceptions -DQT_NO_DEBUG +CFLAGS = -pipe -Wall -W -O2 -DQT_NO_DEBUG +CXXFLAGS = -pipe -Wall -W -O2 -DQT_NO_DEBUG LEXFLAGS = YACCFLAGS= -d INCPATH = -I$(QTDIR)/include -I$(QTDIR)/mkspecs/default LINK = g++ LFLAGS = -LIBS = $(SUBLIBS) -L$(QTDIR)/lib -L/usr/X11R6/lib -lqt -ldl -lXinerama -lSM -lqt-mt -lXext -lX11 -lm +LIBS = $(SUBLIBS) -Wl,-rpath,$(QTDIR)/lib -L$(QTDIR)/lib -L/usr/X11R6/lib -ldl -lXinerama -lSM -lqt-mt -lXext -lX11 -lm -lpthread -lXrender -lXinerama -lGL AR = ar cqs RANLIB = MOC = $(QTDIR)/bin/moc diff --git a/src/SALOME_InstallWizard.cxx b/src/SALOME_InstallWizard.cxx index d43c3b5..db628fc 100644 --- a/src/SALOME_InstallWizard.cxx +++ b/src/SALOME_InstallWizard.cxx @@ -959,15 +959,31 @@ bool SALOME_InstallWizard::acceptData( const QString& pageTitle ) #ifdef DEBUG cout << "1. Script : " << script << endl; #endif - if ( system( script ) ) { - QMessageBox::warning( this, - tr( "Warning" ), - tr( "You don't have native %1 %2 installed").arg(item->text(0)).arg(item->text(1)), - QMessageBox::Ok, - QMessageBox::NoButton, - QMessageBox::NoButton ); - productsView->setNone( item ); - return false; + int res = system( script ) / 256; // return code is * 256 +#ifdef DEBUG + cout << "try_native() : res = " << res << endl; +#endif + if ( res > 0 ) { + if ( res == 2 ) { + // when try_native returns 2 it means that native product version is higher than that is prerequisited + if ( QMessageBox::warning( this, + tr( "Warning" ), + tr( "You have newer version of %1 installed on your computer than that is required (%2).\nContinue?").arg(item->text(0)).arg(item->text(1)), + QMessageBox::Yes, + QMessageBox::No, + QMessageBox::NoButton ) == QMessageBox::No ) + return false; + } + else { + QMessageBox::warning( this, + tr( "Warning" ), + tr( "You don't have native %1 %2 installed").arg(item->text(0)).arg(item->text(1)), + QMessageBox::Ok, + QMessageBox::NoButton, + QMessageBox::NoButton ); + productsView->setNone( item ); + return false; + } } } else {