]> SALOME platform Git repositories - tools/install.git/commitdiff
Salome HOME
SALOME 7.3.0 preparation : change release_notes.sh script
authorvsr <vsr@opencascade.com>
Tue, 24 Dec 2013 06:13:06 +0000 (06:13 +0000)
committervsr <vsr@opencascade.com>
Tue, 24 Dec 2013 06:13:06 +0000 (06:13 +0000)
config_files/release_notes.sh

index 1175bac389835207fb29d5d8407d0170409df809..18c3fe7ed63380f1b42cb05dca5e494c61920a0f 100755 (executable)
@@ -28,13 +28,12 @@ check_enabled()
        fi
     done
     # 2. check if Release Notes file is available
-    if [ "${ROOT_DIR}" != "" ] ; then 
-       rn_files=`find ${ROOT_DIR} -maxdepth 1 -name "*Release_Notes.pdf"`
-       if [ "$?" = "0" ] && [ "${rn_files}" != "" ] && [ "${reader}" != "" ] ; then
-           return 0;
-       fi
+    VER=`echo ${SALOME_VERSION} | tr "." "_"`
+    rn_file=${ROOT_DIR}/SALOME_${VER}_Release_Notes.pdf
+    if [ -f "${rn_file}" ] && [ "${reader}" != "" ] ; then
+       return 0
     fi
-    return 1;
+    return 1
 }
 
 # This procedure is used to show Release Notes file.
@@ -44,28 +43,31 @@ execute()
     ROOT_DIR=`(cd ${SCRIPT_DIR}/.. ; pwd)`;
     # 1. find appropriate PDF files viewer
     for r in ${VIEWER_PROGRAMS} ; do
-       reader=`which ${r} 2> /dev/null`
+       reader=`which ${r} 2>/dev/null`
        if [ "$?" = "0" ] ; then
            break;
        fi
     done
     # 2. find Release Notes file and open it in the viewer
-    if [ "${ROOT_DIR}" != "" ] ; then 
-       rn_file=`find ${ROOT_DIR} -maxdepth 1 -name "*Release_Notes.pdf"`
-       if [ "$?" = "0" ] && [ "${rn_file}" != "" ] && [ "${reader}" != "" ] ; then
-           ${reader} ${rn_file} &
-           return 0;
-       fi
+    VER=`echo ${SALOME_VERSION} | tr "." "_"`
+    rn_file=${ROOT_DIR}/SALOME_${VER}_Release_Notes.pdf
+    if [ -f "${rn_file}" ] && [ "${reader}" != "" ] ; then
+       ${reader} ${rn_file} &
+       return 0;
     fi
     return 1;
 }
 
+SCRIPT_DIR=`dirname $0`
+
+source ${SCRIPT_DIR}/common.sh
+
 # Set general usage variables from the command line parameters:
 #     $0 is the path to this script itself
 #     $1 is the name of the procedure to be run
-#     $2 is the installation directory path
-#     $3 is the temporary directory path
-SCRIPT_DIR=`dirname $0`
+#     $2 is the installation directory path (not currently used)
+#     $3 is the temporary directory path (not currently used)
+
 PROCEDURE=$1;
 INST_ROOT=$2;
 INSTALL_WORK=$3;