[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: gschemdoc.sh



  User: cnieves 
  Date: 06/09/27 14:04:35

  Modified:    .        gschemdoc.sh
  Log:
  Applied (partially) patch #1511658 by Cesar Strauss. 
  
  The rest of the patch was already covered by patches #1564796 and #1564805. 
  
  Thanks.
  
  
  
  
  Revision  Changes    Path
  1.9       +44 -12    eda/geda/gaf/utils/scripts/gschemdoc.sh
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: gschemdoc.sh
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/utils/scripts/gschemdoc.sh,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- gschemdoc.sh	20 Aug 2005 15:52:33 -0000	1.8
  +++ gschemdoc.sh	27 Sep 2006 18:04:34 -0000	1.9
  @@ -1,5 +1,5 @@
   #!/bin/sh
  -# $Id: gschemdoc.sh,v 1.8 2005/08/20 15:52:33 werner Exp $
  +# $Id: gschemdoc.sh,v 1.9 2006/09/27 18:04:34 cnieves Exp $
   #
   # NOTE: built from gschemdoc.sh
   #
  @@ -25,7 +25,7 @@
   #
   # these may be changed to suit local preferences
   #
  -CANDIDATE_BROWSER="galeon mozilla phoenix netscape netscape-navigator opera firefox konqueror"
  +CANDIDATE_BROWSER="galeon mozilla phoenix netscape netscape-navigator opera firefox konqueror iexplore"
   CANDIDATE_PDFREADER="xpdf acroread ggv gv"
   CANDIDATE_LOCATE="slocate locate"
   
  @@ -39,11 +39,26 @@
   #
   view_file_if_pdf()
   {
  -	if test -f "$1" && (file "$1" | grep -q "PDF") && test "${pdfreader}"!="no"; then
  +	# If we are on Cygwin, translate the path
  +	# so native applications can find the file
  +	if test "${cygpath}" != "no" ; then
  +		file=`cygpath -w $1`
  +	else
  +		file=$1
  +	fi
  +
  +	if test -f "$1" && (file "$1" | grep -q "PDF") ; then
  +		if test "${pdfreader}" != "no"; then
   		echo "Found ${pdfreader}"
  -		echo "Using PDF viewer and file: $1"
  -		${pdfreader} -- "$1"
  +			echo "Using PDF viewer and file: $file"
  +			# NOTE: Acrobat Reader on Windows does not seem to support
  +			#       -- on the command line
  +			${pdfreader} "$file"
   		exit
  +		else
  +			echo "Did not find a PDF viewer application."
  +			exit
  +		fi
   	fi
   }
   
  @@ -52,12 +67,23 @@
   #
   view_file_browser()
   {
  +	# If we are on Cygwin, translate the path
  +	# so native applications can find the file
  +	if test "${cygpath}" != "no" ; then
  +		file=`cygpath -w $1`
  +	else
  +		file=$1
  +	fi
  +	
   	if test "${browser}" != "no" ; then
   		echo "Found ${browser}"
  -		echo "Using browser and file: $1"
  +		echo "Using browser and file: $file"
   		# NOTE: Mozilla and Netscape does not seem to support
   		#       -- on the command line
  -		${browser} "file:$1"
  +		${browser} "file:$file"
  +		exit
  +	else
  +		echo "Did not find a browser application."
   		exit
   	fi
   }
  @@ -71,6 +97,9 @@
   		echo "Go look for: $1"
   		${browser} "http://www.google.com/search?q=$1%20filetype:pdf";
   		exit
  +	else
  +		echo "Did not find a browser application."
  +		exit
   	fi
   }
   
  @@ -84,7 +113,7 @@
   	fi
   	if test "${locate}" != "no"; then
   		b=`${locate} -- "/$1"`
  -		if test `echo "$b" | wc -l` -ge 1; then
  +		if test `echo "$b" | wc -w` -ge 1; then
   			view_file_browser "`echo "$b" | head -n1`"
   		fi
   	fi
  @@ -110,6 +139,9 @@
   	b=`which $a 2>/dev/null` && locate=$b && break
   done
   
  +cygpath="no"
  +b=`which cygpath 2>/dev/null` && cygpath=$b
  +
   #
   #  documentation case first
   #  NOTE: this is too crude..
  @@ -150,7 +182,7 @@
   #
   if test "$1" != "" && test "${locate}" != "no"; then
   	b=`${locate} -- "/$1"`
  -	if test `echo "$b" | wc -l` -ge 1; then
  +	if test `echo "$b" | wc -w` -ge 1; then
   		n="`echo "$b" | head -n1`"
   		view_file_if_pdf "$n"
   		view_file_browser "$n"
  @@ -215,7 +247,7 @@
   #
   if test "${symbolbase}" != "" && test "${pdfreader}" != "no"; then
   	for s in .pdf .PDF; do
  -		view_file_pdf "${DOCDIR}/${symbolbase}$s"
  +		view_file_if_pdf "${DOCDIR}/${symbolbase}$s"
   	done
   fi
   
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs