[rkward-cvs] rkward/rkward Makefile.am,1.66,1.67 makerkwardscript.pl,1.2,1.3 rkward.sh.template,1.3,1.4

Thomas Friedrichsmeier tfry at users.sourceforge.net
Mon Apr 17 14:05:56 UTC 2006


Update of /cvsroot/rkward/rkward/rkward
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7005

Modified Files:
	Makefile.am makerkwardscript.pl rkward.sh.template 
Log Message:
Simplify wrapper script, remove unneeded --with-r-doc and --with-r-share options

Index: rkward.sh.template
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.sh.template,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rkward.sh.template	6 Apr 2006 13:37:42 -0000	1.3
--- rkward.sh.template	17 Apr 2006 14:05:54 -0000	1.4
***************
*** 1,63 ****
  #!/bin/sh
! # Shell wrapper for rkward executable. Mostly copied from the wrapper for R executable.
  
  R_HOME_DIR=###R_HOME_DIR###
! if test -n "${R_HOME}" && \
!    test "${R_HOME}" != "${R_HOME_DIR}"; then
!   echo "WARNING: ignoring environment value of R_HOME"
! fi
! R_HOME="${R_HOME_DIR}"
! export R_HOME
! R_SHARE_DIR=###R_SHARE_DIR###
! export R_SHARE_DIR
! R_INCLUDE_DIR=###R_INCLUDE_DIR###
! export R_INCLUDE_DIR
! R_DOC_DIR=###R_DOC_DIR###
! export R_DOC_DIR
! 
! # Adjust library path so libR.so can be located
! ## NOTE:
! ## We must set this here rather than in the main binary.
! : ${R_LD_LIBRARY_PATH=${R_HOME}/lib}
! if test -z "${LD_LIBRARY_PATH}"; then
!   LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}"
! else
!   LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}"
! fi
! export LD_LIBRARY_PATH
! 
! error () {
!   echo "ERROR: $*" >&2
!   exit 1
! }
  
! ## R_HOME may have moved, so check
! ## (or you get "GUI X11 is not supported")
! if test -x "${R_HOME}"; then
    :
  else
!   error "R_HOME ('${R_HOME}') not found. Most likely your installation of R has moved to a new location. Please rebuild rkward."
  fi
  
- ## Create a per-session dir
- : ${TMPDIR=/tmp}
- { tmp=`(umask 077 && mktemp -d -q "${TMPDIR}/RtmpXXXXXX") 2>/dev/null` \
-     && test -n "${tmp}" && test -d "${tmp}" ; } ||
-   { test -n "${RANDOM}" && tmp=${TMPDIR}/Rtmp$$-${RANDOM} \
-       && (umask 077 && mkdir "${tmp}") ; } ||
-   { tmp=${TMPDIR}/Rtmp$$ && (umask 077 && mkdir "${tmp}") ; } ||
-   error "cannot create temporary R session directory"
- R_SESSION_TMPDIR="${tmp}"
- export R_SESSION_TMPDIR
- 
  ## Apparently on some systems an embedded R gets outsmarted somehow, and LC_NUMERIC is set to some dangerous value for the whole app (likely via some Qt stuff)
  ## To prevent this, set it here, explicitely. R does not work with wrong settings of LC_NUMERIC.
  export LC_NUMERIC="C"
  
! ## Start rkward
! exec $0.bin "$@"
! 
! ### Local Variables: ***
! ### mode: sh ***
! ### sh-indentation: 2 ***
! ### End: ***
--- 1,19 ----
  #!/bin/sh
! # Shell wrapper for rkward executable.
  
  R_HOME_DIR=###R_HOME_DIR###
! R_binary="$R_HOME_DIR/bin/R"
  
! ## Location of R may have moved, so check
! if test -x "${R_binary}"; then
    :
  else
!   error "R binary ('${R_binary}') not found. Most likely your installation of R has moved to a new location. Please rebuild rkward."
  fi
  
  ## Apparently on some systems an embedded R gets outsmarted somehow, and LC_NUMERIC is set to some dangerous value for the whole app (likely via some Qt stuff)
  ## To prevent this, set it here, explicitely. R does not work with wrong settings of LC_NUMERIC.
  export LC_NUMERIC="C"
  
! ## Start rkward. Running through R CMD to set all the relevant R enviroment variables
! exec $R_binary CMD $0.bin "$@"

Index: makerkwardscript.pl
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/makerkwardscript.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** makerkwardscript.pl	21 Feb 2006 13:26:18 -0000	1.2
--- makerkwardscript.pl	17 Apr 2006 14:05:54 -0000	1.3
***************
*** 3,9 ****
  $template = $ARGV[0];
  $r_home = "\"$ARGV[1]\"";
- $r_includes = "\"$ARGV[2]\"";
- $r_share = "\"$ARGV[3]\"";
- $r_doc = "\"$ARGV[4]\"";
  
  open (TEMPLATE, "< $template") or die "Can't open template";
--- 3,6 ----
***************
*** 11,17 ****
  	$line = $_;
  	$line =~ s/###R_HOME_DIR###/$r_home/;
- 	$line =~ s/###R_INCLUDE_DIR###/$r_includes/;
- 	$line =~ s/###R_SHARE_DIR###/$r_share/;
- 	$line =~ s/###R_DOC_DIR###/$r_doc/;
  	print ($line);
  }
--- 8,11 ----

Index: Makefile.am
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/Makefile.am,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** Makefile.am	17 Apr 2006 12:13:52 -0000	1.66
--- Makefile.am	17 Apr 2006 14:05:54 -0000	1.67
***************
*** 65,69 ****
  # all the perl script does is fill in the placeholder for R_HOMEDIR and friends
  rkward:
! 	perl ./makerkwardscript.pl rkward.sh.template "$(R_HOMEDIR)" "$(R_INCLUDEDIR)" "$(R_SHAREDIR)" "$(R_DOCDIR)" > rkward; \
  	chmod 744 rkward
  
--- 65,69 ----
  # all the perl script does is fill in the placeholder for R_HOMEDIR and friends
  rkward:
! 	perl ./makerkwardscript.pl rkward.sh.template "$(R_HOMEDIR)" > rkward; \
  	chmod 744 rkward
  





More information about the rkward-tracker mailing list