The R Project SVN R

Rev

Rev 37694 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37694 Rev 37712
Line 5... Line 5...
5
# @configure_input@
5
# @configure_input@
6
 
6
 
7
## Trap interrupts, most importantly 2 (^C from keyboard)
7
## Trap interrupts, most importantly 2 (^C from keyboard)
8
trap do_exit_on_error 1 2 15
8
trap do_exit_on_error 1 2 15
9
 
9
 
10
revision='$Rev: 37694 $'
10
revision='$Rev: 37712 $'
11
version=`set - ${revision}; echo ${2}`
11
version=`set - ${revision}; echo ${2}`
12
version="R add-on package installer ${version}
12
version="R add-on package installer ${version}
13
 
13
 
14
Copyright (C) 2000-2006 The R Core Development Team.
14
Copyright (C) 2000-2006 The R Core Development Team.
15
This is free software; see the GNU General Public Licence version 2
15
This is free software; see the GNU General Public Licence version 2
Line 191... Line 191...
191
use_zip_data=
191
use_zip_data=
192
use_zip_help=
192
use_zip_help=
193
configure_args=
193
configure_args=
194
configure_vars=
194
configure_vars=
195
with_package_versions=false
195
with_package_versions=false
196
save="CHECK"
196
save=false
197
save_args=
197
save_args=
198
fake=false
198
fake=false
199
lazy="auto"
199
lazy="auto"
200
lazy_data=false
200
lazy_data=false
201
lock=true
201
lock=true
Line 703... Line 703...
703
    cp -r inst/* "${R_PACKAGE_DIR}" || \
703
    cp -r inst/* "${R_PACKAGE_DIR}" || \
704
      (cd inst && ${TAR} cf - . | \
704
      (cd inst && ${TAR} cf - . | \
705
        (cd "${R_PACKAGE_DIR}" && ${TAR} xf -))
705
        (cd "${R_PACKAGE_DIR}" && ${TAR} xf -))
706
  fi
706
  fi
707
 
707
 
-
 
708
  if test -r install.R; then 
-
 
709
      warning "use of install.R is no longer supported"
-
 
710
  fi
-
 
711
  if test -r R_PROFILE.R; then 
-
 
712
      warning "use of R_PROFILE.R is no longer supported"
-
 
713
  fi
708
  parse_description_field SaveImage
714
  parse_description_field SaveImage
709
  if test "$value" != "missing" ; then
715
  if test "$value" != "missing" ; then
710
    save=${value}
716
    save=${value}
711
  fi
717
  fi
712
  case ${save} in
-
 
713
    CHECK)
-
 
714
      if test -r install.R; then
-
 
715
	R_SAVE_IMAGE=true;
-
 
716
      else
-
 
717
	R_SAVE_IMAGE=false;
-
 
718
      fi
-
 
719
      ;;
-
 
720
    *)
-
 
721
      R_SAVE_IMAGE=${save} ;;
-
 
722
  esac
-
 
723
  ## sanity check
718
  ## sanity check
724
  if test ! -d R ; then
719
  if test ! -d R ; then
725
    R_SAVE_IMAGE=false
720
    R_SAVE_IMAGE=false
-
 
721
  else
-
 
722
    R_SAVE_IMAGE=${save}
726
  fi
723
  fi
727
  export R_SAVE_IMAGE
724
  export R_SAVE_IMAGE
728
 
725
 
729
  if ${R_SAVE_IMAGE}; then
726
  if ${R_SAVE_IMAGE}; then
730
    message "save image"
727
    message "save image"
Line 748... Line 745...
748
      code_cmd="eval cat \"${code_file}\""
745
      code_cmd="eval cat \"${code_file}\""
749
      loader_file=firstlib.R
746
      loader_file=firstlib.R
750
      R_save_args="--vanilla --slave --save"
747
      R_save_args="--vanilla --slave --save"
751
    fi
748
    fi
752
    (echo "options(save.image.defaults=${save_image_defaults})"; \
749
    (echo "options(save.image.defaults=${save_image_defaults})"; \
753
      if test -s R_PROFILE.R; then cat R_PROFILE.R; fi; \
-
 
754
      echo "invisible(.libPaths(c(\"${lib}\", .libPaths()))); .getRequiredPackages()"; \
750
      echo "invisible(.libPaths(c(\"${lib}\", .libPaths()))); .getRequiredPackages()"; \
755
      ${code_cmd}) | \
751
      ${code_cmd}) | \
756
        R_DEFAULT_PACKAGES= LC_ALL=C "${R_EXE}" ${R_save_args} ${save_args}
752
        R_DEFAULT_PACKAGES= LC_ALL=C "${R_EXE}" ${R_save_args} ${save_args}
757
    if test ${?} -ne 0; then
753
    if test ${?} -ne 0; then
758
      error "execution of package source for '${pkg_name}' failed"
754
      error "execution of package source for '${pkg_name}' failed"
Line 761... Line 757...
761
    test -f NAMESPACE || mv .RData "${rda_file}"
757
    test -f NAMESPACE || mv .RData "${rda_file}"
762
    ## we used to install the dumped code but this seems a waste of space
758
    ## we used to install the dumped code but this seems a waste of space
763
    rm "${code_file}"
759
    rm "${code_file}"
764
    # mv "${code_file}" "${R_PACKAGE_DIR}/R/${pkg_name}.R"
760
    # mv "${code_file}" "${R_PACKAGE_DIR}/R/${pkg_name}.R"
765
    cat "${R_SHARE_DIR}/R/${loader_file}" > "${code_file}"
761
    cat "${R_SHARE_DIR}/R/${loader_file}" > "${code_file}"
766
    ## If install.R is non-empty, arrange to evaluate the R code it
-
 
767
    ## contains after the package loader.
-
 
768
    if test -s install.R; then
-
 
769
      cat install.R >> "${R_PACKAGE_DIR}/R/${R_PACKAGE_NAME}"
-
 
770
    fi
-
 
771
  fi
762
  fi
772
 
763
 
773
  parse_description_field LazyLoad
764
  parse_description_field LazyLoad
774
  if test "$value" = "missing" ; then
765
  if test "$value" = "missing" ; then
775
    thislazy=${lazy}
766
    thislazy=${lazy}
Line 790... Line 781...
790
      thislazy=false
781
      thislazy=false
791
    fi
782
    fi
792
  fi
783
  fi
793
  if ${thislazy}; then
784
  if ${thislazy}; then
794
    message "preparing package for lazy loading"
785
    message "preparing package for lazy loading"
795
    (if test -s R_PROFILE.R; then cat R_PROFILE.R; fi; \
-
 
796
    echo "invisible(.libPaths(c(\"${lib}\", .libPaths()))); .getRequiredPackages(); tools:::makeLazyLoading(\"${R_PACKAGE_NAME}\", \"${lib}\")") | \
786
    (echo "invisible(.libPaths(c(\"${lib}\", .libPaths()))); .getRequiredPackages(); tools:::makeLazyLoading(\"${R_PACKAGE_NAME}\", \"${lib}\")") | \
797
      R_DEFAULT_PACKAGES= LC_ALL=C "${R_EXE}" --vanilla --slave
787
      R_DEFAULT_PACKAGES= LC_ALL=C "${R_EXE}" --vanilla --slave
798
    if test ${?} -ne 0; then
788
    if test ${?} -ne 0; then
799
      error "lazy loading failed for package '${pkg_name}'"
789
      error "lazy loading failed for package '${pkg_name}'"
800
      do_exit_on_error
790
      do_exit_on_error
801
    fi
791
    fi
802
    rm -f ${R_PACKAGE_DIR}/R/all.rda
792
    rm -f ${R_PACKAGE_DIR}/R/all.rda
803
    if test -s install.R; then
-
 
804
      cat install.R >> "${R_PACKAGE_DIR}/R/${R_PACKAGE_NAME}"
-
 
805
    fi
-
 
806
  fi
793
  fi
807
 
794
 
808
  if test -d man; then
795
  if test -d man; then
809
    message "help"
796
    message "help"
810
    ## Install man sources ...
797
    ## Install man sources ...