The R Project SVN R

Rev

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

Rev 27847 Rev 27850
Line 13... Line 13...
13
 
13
 
14
if test "x${BUILD}" = "xCROSS"; then
14
if test "x${BUILD}" = "xCROSS"; then
15
R_DEFAULT_PACKAGES=NULL
15
R_DEFAULT_PACKAGES=NULL
16
export R_DEFAULT_PACKAGES
16
export R_DEFAULT_PACKAGES
17
R_EXE="${RX_EXE} --slave --no-site-file --no-init-file"
17
R_EXE="${RX_EXE} --slave --no-site-file --no-init-file"
-
 
18
## we have to install into a temporary dir to avoid libpath problems
-
 
19
lib1=/tmp/RtmpWin
18
else
20
else
19
R_EXE="${R_HOME}/bin/Rterm --slave --no-site-file --no-init-file R_DEFAULT_PACKAGES=NULL"
21
R_EXE="${R_HOME}/bin/Rterm --slave --no-site-file --no-init-file R_DEFAULT_PACKAGES=NULL"
-
 
22
lib1=${lib}
20
fi
23
fi
21
 
24
 
22
## This is apparently needed, but no one told the Windows maintainers.
25
## This is apparently needed, but no one told the Windows maintainers.
23
R_PACKAGE_NAME=${pkg}
26
R_PACKAGE_NAME=${pkg}
24
export R_PACKAGE_NAME
27
export R_PACKAGE_NAME
25
 
28
 
26
if ${R_SAVE_IMAGE}; then
29
if ${R_SAVE_IMAGE}; then
27
    echo "  save image"
30
    echo "  save image"
-
 
31
    if test "x${BUILD}" = "xCROSS"; then
-
 
32
        mkdir -p ${lib1}/${pkg}
-
 
33
        cp -r ${lib}/${pkg}/DESCRIPTION ${lib}/${pkg}/R ${lib1}/${pkg}
-
 
34
        if test -f NAMESPACE; then
-
 
35
          cp ${lib}/${pkg}/NAMESPACE ${lib1}/${pkg}
-
 
36
        fi
-
 
37
    fi
28
    save_image_defaults="list(compress=TRUE, safe=FALSE)"
38
    save_image_defaults="list(compress=TRUE, safe=FALSE)"
29
    code_file="${lib}/${pkg}/R/${pkg}"
39
    code_file="${lib}/${pkg}/R/${pkg}"
30
    rda_file="${lib}/${pkg}/R/all.rda"
40
    rda_file="${lib}/${pkg}/R/all.rda"
31
    if test -f NAMESPACE; then
41
    if test -f NAMESPACE; then
32
        code_cmd="echo saveNamespaceImage(\"${pkg}\", \"${rda_file}\", \"${lib}\")"
42
        code_cmd="echo saveNamespaceImage(\"${pkg}\", \"${rda_file}\", \"${lib1}\")"
33
        loader_file=nsrdaload.R
43
        loader_file=nsrdaload.R
34
        R_SAVE_EXE=""
44
        R_SAVE_EXE=""
35
    else
45
    else
36
        code_cmd="cat ${code_file}"
46
        code_cmd="cat ${code_file}"
37
        loader_file=firstlib.R
47
        loader_file=firstlib.R
38
        R_SAVE_EXE="--save"
48
        R_SAVE_EXE="--save"
39
    fi
49
    fi
40
    (echo "options(save.image.defaults=${save_image_defaults})"; \
50
    (echo "options(save.image.defaults=${save_image_defaults})"; \
41
      if test -s R_PROFILE.R; then cat R_PROFILE.R; fi; \
51
      if test -s R_PROFILE.R; then cat R_PROFILE.R; fi; \
42
      echo "invisible(.libPaths(c(\"${lib}\", .libPaths())))"; \
52
      echo "invisible(.libPaths(c(\"${lib1}\", .libPaths())))"; \
43
      ${code_cmd}) | ${R_EXE} ${R_SAVE_EXE} \
53
      ${code_cmd}) | ${R_EXE} ${R_SAVE_EXE} \
44
        || (echo "Execution of package source for ${pkg} failed"; exit 1)
54
        || (echo "Execution of package source for ${pkg} failed"; exit 1)
45
    if test ! -f NAMESPACE; then
55
    if test ! -f NAMESPACE; then
46
        mv .RData ${rda_file}
56
        mv .RData ${rda_file}
47
    fi
57
    fi
-
 
58
    if test "x${BUILD}" = "xCROSS"; then
-
 
59
        rm -rf ${lib1}
-
 
60
    fi
48
    ## we used to install the dumped code but this seems a waste of space
61
    ## we used to install the dumped code but this seems a waste of space
49
    rm "${code_file}"
62
    rm "${code_file}"
50
    # mv "${code_file}" "${code_file}.R"
63
    # mv "${code_file}" "${code_file}.R"
51
    cat "${R_HOME}/share/R/${loader_file}" > "${code_file}"
64
    cat "${R_HOME}/share/R/${loader_file}" > "${code_file}"
52
    ## if install.R is non-empty, arrange to evaluate the R code it
65
    ## if install.R is non-empty, arrange to evaluate the R code it