X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=config_files%2Frelease_notes.sh;h=9b3f3b0c04c03b7bbca09c3c8b93d52f70dabafd;hb=d70c265397805fef35d2b90ff06f831fddf912b7;hp=cc2c064d58a36385f42ca6f858a6adf37366cebb;hpb=0bafc2f7a14b28b9ddaa2f53ca26d412ea83fd71;p=tools%2Finstall.git diff --git a/config_files/release_notes.sh b/config_files/release_notes.sh index cc2c064..9b3f3b0 100755 --- a/config_files/release_notes.sh +++ b/config_files/release_notes.sh @@ -1,21 +1,33 @@ -#!/bin/sh +#!/bin/bash -noprofile #################################################################################### -# -# The script is the part of the SALOME installation procedure. -# This script is used to show SALOME Release Notes. +# File : release_notes.sh +# Created : Tue Oct 30 11:11:23 2006 +# Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com) +# Project : SALOME +# Module : Installation Wizard +# Copyright : 2002-2008 CEA +# +# This script is the part of the SALOME installation procedure. # -# Copyright : 2006 CEA/DEN, EDF R&D #################################################################################### # This procedure checks if the Release Notes file can be shown. # Returns 0 in success and 1 if any error occurs. check_enabled() { - ROOT_DIR=`(cd ${SRC_DIR}\.. ; pwd)`; + ROOT_DIR=`(cd ${SCRIPT_DIR}/.. ; pwd)`; + # 1. check if there is appropriate PDF files viewer + for r in acroread kpdf kghostview xpdf ; do + reader=`which $r 2>/dev/null` + if [ "$?" == "0" ] ; then + break; + fi + done + # 2. check if Release Notes file is available if [ "${ROOT_DIR}" != "" ] ; then - rn_files=`find ${ROOT_DIR} -name "*Release_Notes.pdf"` - if [ "$?" == "0" ] && [ "$rn_files" != "" ] ; then + rn_files=`find ${ROOT_DIR} -maxdepth 1 -name "*Release_Notes.pdf"` + if [ "$?" == "0" ] && [ "$rn_files" != "" ] && [ "$reader" != "" ] ; then return 0; fi fi @@ -26,15 +38,20 @@ check_enabled() # Returns 0 in success and 1 if any error occurs. execute() { - ROOT_DIR=`(cd ${SRC_DIR}\.. ; pwd)`; + ROOT_DIR=`(cd ${SCRIPT_DIR}/.. ; pwd)`; + # 1. find appropriate PDF files viewer + for r in acroread kpdf kghostview xpdf ; do + 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} -name "*Release_Notes.pdf"` - if [ "$?" == "0" ] && [ "$rn_file" != "" ] ; then - xpdf=`which xpdf >& /dev/null` - if [ "$?" == "0" ] ; then - xpdf ${rn_file} & - return 0; - fi + rn_file=`find ${ROOT_DIR} -maxdepth 1 -name "*Release_Notes.pdf"` + if [ "$?" == "0" ] && [ "$rn_file" != "" ] && [ "$reader" != "" ] ; then + $reader ${rn_file} & + return 0; fi fi return 1; @@ -47,7 +64,7 @@ execute() # $3 is the temporary directory path SCRIPT_DIR=`dirname $0` PROCEDURE=$1; -INSTALL_ROOT=$2; +INST_ROOT=$2; INSTALL_WORK=$3; # Run the procedure