Skip to content

Commit

Permalink
updateR - added copy_Rprofile.site option. Requested by: rsuhada, leeper
Browse files Browse the repository at this point in the history
  • Loading branch information
talgalili committed Jul 27, 2014
1 parent 1121d3f commit c22de7e
Show file tree
Hide file tree
Showing 8 changed files with 292 additions and 13 deletions.
18 changes: 15 additions & 3 deletions ChangeLog
@@ -1,10 +1,22 @@
* 2014-07-11(Tal Galili) R_version_in_a_folder - updated so it could handle "patched" versions of R. |42e35b7|
| ChangeLog | 14 ++++++++++++++
* 2014-07-27(talgalili) updateR - added copy_Rprofile.site option. Requested by: rsuhada, leeper |7871e9a|
| DESCRIPTION | 4 ++--
| NEWS | 14 ++++++++++++++
| R/updateR.R | 21 +++++++++++++++++++--
| man/rename_r_to_R.Rd | 2 +-
| man/updateR.Rd | 15 +++++++++++----
| 5 files changed, 47 insertions(+), 9 deletions(-)

* 2014-07-24(talgalili) Fix the ask=FALSE option in require2 |1121d3f|
| R/install.R | 10 ++++++++--
| 1 file changed, 8 insertions(+), 2 deletions(-)

* 2014-07-11(Tal Galili) R_version_in_a_folder - updated so it could handle "patched" versions of R. |3df8095|
| ChangeLog | 22 ++++++++++++++++++++++
| DESCRIPTION | 4 ++--
| NEWS | 6 ++++++
| R/rename_r_to_R.R | 2 +-
| R/updateR.R | 1 +
| 5 files changed, 24 insertions(+), 3 deletions(-)
| 5 files changed, 32 insertions(+), 3 deletions(-)

* 2014-07-10(Tal Galili) bump to 0.15.6 |4ce9edc|
| DESCRIPTION | 4 ++--
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
@@ -1,8 +1,8 @@
Package: installr
Type: Package
Title: Using R to install stuff (such as: R, Rtools, RStudio, git, and more!)
Version: 0.15.7
Date: 2014-07-11
Version: 0.15.9
Date: 2014-07-27
Authors@R: c(person("Tal", "Galili", role = c("aut", "cre", "cph"), email =
"tal.galili@gmail.com", comment = "http://www.r-statistics.com"),
person("Barry", "Rowlingson", role = "ctb", email =
Expand Down
14 changes: 14 additions & 0 deletions NEWS
@@ -1,3 +1,17 @@
installr 0.15.9 (2014-07-27)
---------------------------

UPDATED FUNCTIONS:
* updateR - added copy_Rprofile.site option. Requested by: rsuhada, leeper (at: https://github.com/talgalili/installr/issues/13)


installr 0.15.8 (2014-07-24)
---------------------------

UPDATED FUNCTIONS:
* require2 - fix ask=FALSE


installr 0.15.7 (2014-07-11)
---------------------------

Expand Down
229 changes: 229 additions & 0 deletions NEWS.md
@@ -1,3 +1,231 @@
installr 0.15.9 (2014-07-27)
---------------------------

UPDATED FUNCTIONS:
* updateR - added copy_Rprofile.site option. Requested by: rsuhada, leeper (at: https://github.com/talgalili/installr/issues/13)


installr 0.15.8 (2014-07-24)
---------------------------

UPDATED FUNCTIONS:
* require2 - fix ask=FALSE


installr 0.15.7 (2014-07-11)
---------------------------

UPDATED FUNCTIONS:
* R_version_in_a_folder - updated so it could handle "patched" versions of R. (bug report thanks to rogerjbos i.e.: https://github.com/rogerjbos)

installr 0.15.6 (2014-07-10)
---------------------------

OTHER NOTES:
* Changed all R script files from .r to .R!

installr 0.15.5 (2014-07-04)
---------------------------
NEW FUNCTIONS:
* rename_r_to_R - Rename files' extensions in a folder from .r to .R.

NEW FILES ADDED:
* rename_r_to_R.R

installr 0.15.4 (2014-06-26)
---------------------------

OTHER NOTES:
* Changed the menu item to be "installr" instead of "Update" (in both zzz.r and startup.r)


installr 0.15.3 (2014-06-14)
---------------------------

OTHER NOTES:
* Fixes to doc in kill_all_Rscript_s and uninstall.packages.
* installr 0.15.3 is to be shipped to CRAN


installr 0.15.2 (2014-06-14)
---------------------------

BUG FIXES:
* install.pandoc - works again. The guys there moved git from googlecode to github, with also a tweak where version numbers can include hyphens ("-").


installr 0.15.1 (2014-06-14)
---------------------------

NEW FUNCTIONS:
* get_pid - get the process id by its name
* kill_pid - kills the process of all the scripts with some pid
* kill_process - kills process with some name


BUG FIXES:
* install.git - works again. The guys there moved git from googlecode to github. (props to Tom Bancroft for the bug report)


installr 0.15.0 (2014-06-08)
---------------------------

NEW FUNCTIONS:
* get_tasklist - returns a data.frame with the current running processes. Windows only.
* get_Rscript_PID - returns all of the process IDs (i.e.: PID) of the Rscript.exe that are running. Windows only.
* kill_all_Rscript_s - kills the process of all the Rscript.exe that are running (you can schedule how long it should wait before doing it). Windows only.


UPDATED FUNCTIONS:
* install.URL - made sure to exit the function if it could not download the file

NEW FILES ADDED:
* kill_pid.r


OTHER NOTES:
* Added copyrights to all .r files.


installr 0.14.5 (2014-05-19)
---------------------------

UPDATED FUNCTIONS: (by Boris Hejblum)
* Update pkgDNLs_worldmapcolor
Updating pkgDNLs_worldmapcolor function with ggplot2::aes_string (better
for R CMD CHECK).
Also, the 'data' directory of the package is not on the CRAN (but is on
the github version of the package). pkgDNLs_worldmapcolor(...) needs the
'WorldBordersData.RData' file in order to work.

installr 0.14.4 (2014-05-08)
---------------------------
UPDATED FUNCTIONS:
* install.pandoc - the project has moved from http://code.google.com/p/pandoc/downloads/list to https://github.com/jgm/pandoc/releases - so the function had to be updated... (props to Patrick Kelley for the bug report)
* install.url - tweaks to the massage.

installr 0.14.3 (2014-05-06)
---------------------------
UPDATED FUNCTIONS:
* install.URL - added installer_option A character of the command line arguments
* install.R, updaeR - added silent installation mode (source: http://hiratake55.wordpress.com/2014/05/01/how-to-do-a-silent-install-of-r/)

UPDATED DESCRIPTION:
* Bump version to 0.14.3
* added Takekatsu Hiramura as a contributor.

installr 0.14.2 (2014-04-17)
---------------------------
NEW FUNCTIONS ADDED:
* uninstall.packages - removes packages from R.


installr 0.14.1 (2014-04-12)
---------------------------
UPDATED FUNCTIONS:
* download_RStudio_CRAN_data - added the override and massage parameters (makes sure we do not have to download files already downloaded)


installr 0.14.0 (2014-04-02)
---------------------------
OTHER NOTES:
* Bump version to 0.14.0 to signify the number of bug fixes from the original 0.13.0.
* installr 0.14.0 is to be shipped to CRAN.


installr 0.13.8 (2014-03-19)
---------------------------
UPDATED FUNCTIONS:
* install.Cygwin - JackStat Fixed URL and added in 32 and 64 bit options. roxygenized


installr 0.13.7 (2014-03-13)
---------------------------
UPDATED FUNCTIONS:
* R_version_in_a_folder - Handled the case of using one directory for subsequent overwriting R installations by selecting the last one. Contributed by Dieter Menne.



installr 0.13.6 (2014-03-12)
---------------------------

UPDATED FUNCTIONS:
* install.URL - new parameters added:
* massage (TRUE) parameter. The function now prints (cat) if the file was downloaded succesfully or not, combined with the location of the file. It also informs the user if the file is later installed/removed or not.
* updateR, install.R - new parameters added:
* keep_install_file parameter (default is FALSE). Based on the request by Boral here: http://www.r-statistics.com/2014/03/r-3-0-3-is-released/
* install.URL, install.R, updateR - new parameters added:
* download_dir (tempdir) character. Allowing the user to choose into which directory the file should be downloaded.

installr 0.13.5 (2014-03-01)
---------------------------

UPDATED FUNCTIONS:
* os.manage - shouldn't ask for minutes if no appropriate option was selected. Don't ask for minutes if 'Cancel' is selected or window was closed without selecting any option. Props to Kornelius Rohmeyer for the commit (rohmeyer@small-projects.de).


installr 0.13.4 (2014-02-06)
---------------------------

UPDATED FUNCTIONS:
* install.pandoc -
* if the installation failed, no need to ask about restarting the computer!
* retiring "use_regex" from service. (props to Scott Milligan for the bug report.)


installr 0.13.3 (2014-02-01)
---------------------------

OTHER NOTES:
* DESCRIPTION:
* Fixed the usage of person()
* minor tweaks to Title and Description
* installr 0.13.3 is to be shipped to CRAN (thanks to the patient guidance of Uwe Ligges!)

installr 0.13.2 (2014-01-31)
---------------------------

OTHER NOTES:
* moved tools from imports to suggest in order to avoid "call not declared from" error.
* Added "RdTags" as an internal function, since using tools:::RdTags caused too many problems.
* Fixed a single "@" in a roxygen2 doc (which caused erros)
* Changed main e-mail to be @gmail instead of @math.tau.ac.il.
* installr 0.13.2 is to be shipped to CRAN.



installr 0.13.1 (2014-01-31)
---------------------------

UPDATED FUNCTIONS:
* read_RStudio_CRAN_data - Added a packages= option to read_RStudio_CRAN_data. read_RStudio_CRAN_data fails on out-of-memory (in the rbindlist call) if you've downloaded many RStudio CRAN logs. This patch adds a packages= option if you're only interested in a subset of packages, which subsets the daily log data on the fly. Other such filters might also be added.
* Changed DESCRIPTION - removed maintainer (to be made automatically)

OTHER NOTES:
* installr 0.13.1 is to be shipped to CRAN.


installr 0.13.0 (2014-01-30)
---------------------------

UPDATED FUNCTIONS:
* make checkMD5 issue warnings (maybe with a dialog box) instead of errors (since the current state of affairs is more hassle than it is worth...)

BUG FIXES:
* Updated some functions and documents in order to pass CRAN checks: RStudio_CRAN_data_folder, pkgDNLs_worldmapcolor, fetch_tag_from_Rd, add_to_.First_in_Rprofile.site, remove_from_.First_in_Rprofile.site, add_load_installr_on_startup_menu.
* README.md - some tweaks to work with the HTML option on CRAN.

OTHER NOTES:
* installr 0.13.0 is to be shipped to CRAN.



installr 0.12.2 (2013-11-26)
---------------------------
UPDATED FUNCTIONS:
* install.pandoc - added "to_restart" parameter. With a massage to remind the user they should restart their computer after pandoc is installed.


installr 0.12.1 (2013-08-23)
---------------------------
BUG FIXES:
Expand Down Expand Up @@ -363,3 +591,4 @@ TODO for future releases:
* install.Rpatch # TODO someday
* install.python # TODO someday
* install.java # with correct downloading for each type of windows R (version 32 or 64 bits...
* install.qpdf - http://sourceforge.net/projects/qpdf/files/qpdf/
21 changes: 19 additions & 2 deletions R/updateR.R
Expand Up @@ -645,6 +645,7 @@ copy.packages.between.libraries <- function(from, to, ask =FALSE,keep_old = TRUE
#' @param browse_news if TRUE (and if there is a newer version of R) - it opens the browser to the NEWS of the latest version of R, for the user to read through
#' @param install_R TRUE/FALSE - if to install a new version of R (if one is available). If missing (this is the default) - the user be asked if to download R or not.Of course the installation part itself (the running of the .exe file) is dependent on the user.
#' @param copy_packages TRUE/FALSE - if to copy your packages from the old version of R to the new version of R. If missing (this is the default) - the user will be asked for his preference (he should say yes, unless he is using a global library folder).
#' @param copy_Rprofile.site logical - if to copy your Rprofile.site from the old version of R to the new version of R. If missing (this is the default) - the user will be asked for his preference (he should say yes, unless he is using a global library folder).
#' @param update_packages TRUE/FALSE - if to update your packages in the new version of R (all packages will be updated without asking confirmation per package) If missing (this is the default) - the user will be asked for his preference (he should say yes, unless he is using a global library folder). This is done by calling the Rscript in the new R.
#' @param keep_old_packages - if the keep the packages in the library of the old R installation. If missing (this is the default) - the user will be asked for his preference (he should say yes, unless he is using a global library folder).
#' @param start_new_R TRUE/FALSE - if to start the new R (Rgui) after we will quit the old R. Default is TRUE. It will try to start the 64 bit R version, if it does not exist, the 32 bit will be started. This may be less useful for people using RStudio or the likes.
Expand All @@ -670,7 +671,8 @@ copy.packages.between.libraries <- function(from, to, ask =FALSE,keep_old = TRUE
#'
#' updateR() # will ask you what you want at every decision.
#' }
updateR <- function(browse_news, install_R, copy_packages, keep_old_packages, update_packages, start_new_R, quit_R, print_R_versions=TRUE, use_GUI = TRUE,
updateR <- function(browse_news, install_R, copy_packages, copy_Rprofile.site,
keep_old_packages, update_packages, start_new_R, quit_R, print_R_versions=TRUE, use_GUI = TRUE,
to_checkMD5sums = TRUE, keep_install_file = FALSE, download_dir = tempdir(), silent = FALSE, ...) {
# this function checks if we have the latest version of R
# IF not - it notifies the user - and leaves.
Expand Down Expand Up @@ -699,7 +701,7 @@ updateR <- function(browse_news, install_R, copy_packages, keep_old_packages, u
did_R_install <- install.R(to_checkMD5sums = to_checkMD5sums, keep_install_file = keep_install_file, download_dir = download_dir, silent = silent)
if(!did_R_install) return(FALSE)
new_R_path <- get.installed.R.folders()[1]

# I could have also used:
# if(unname(up_folder(new_R_path))!=unname(up_folder(old_R_path))) {
# but if the new R is installed somehwere else, then when fetching
Expand All @@ -722,6 +724,21 @@ your packages to the new R installation.\n")
# Next, copy (or MOVE):
copy.packages.between.libraries(keep_old=keep_old_packages)
}


if(missing(copy_Rprofile.site)) copy_Rprofile.site <- ask.user.yn.question("Do you wish to copy your 'Rprofile.site' from the older version of R to the newer version of R?")

if(copy_Rprofile.site) {
old_R_path_etc <- file.path(old_R_path, "etc")
new_R_path_etc <- file.path(new_R_path, "etc")
if("Rprofile.site" %in% list.files(old_R_path_etc)) {
file.copy(from = file.path(old_R_path_etc, "Rprofile.site"),
to = file.path(new_R_path_etc, "Rprofile.site"))
} else {
warning('"Rprofile.site" does not exist in your old R-etc folder')
}
}


# should we update_packages?
if(missing(update_packages)) update_packages <- ask.user.yn.question("Do you wish to update your packages in the newely installed R? ", use_GUI = use_GUI)
Expand Down
2 changes: 1 addition & 1 deletion R/zzz.R
Expand Up @@ -204,7 +204,7 @@ installrWelcomeMessage <- function(){
# check()
# check(args="--as-cran")
# Thanks to: http://stackoverflow.com/questions/10017702/r-cmd-check-options-for-more-rigorous-testing-2-15-0
# file.copy("NEWS", "NEWS.md")
# file.copy("NEWS", "NEWS.md", overwrite = TRUE)
# build_win(version = "R-devel")
# release(check = TRUE)

Expand Down
2 changes: 1 addition & 1 deletion man/rename_r_to_R.Rd
Expand Up @@ -49,7 +49,7 @@ rename_r_to_R(recursive = TRUE, massage = FALSE) # Changes
# ALL of the .r files underneath the current
# working directory


# source: http://stackoverflow.com/questions/52950/how-to-make-git-ignore-changes-in-case
# First run the following in git bash:
# git config core.ignorecase false
rename_r_to_R(recursive = TRUE, text_to_find="\\\\.R$", new_extension = ".b")
Expand Down
15 changes: 11 additions & 4 deletions man/updateR.Rd
Expand Up @@ -3,10 +3,11 @@
\alias{updateR}
\title{Checks for the latest R version, and if there is a newer version of R - downloads and installs it.}
\usage{
updateR(browse_news, install_R, copy_packages, keep_old_packages,
update_packages, start_new_R, quit_R, print_R_versions = TRUE,
use_GUI = TRUE, to_checkMD5sums = TRUE, keep_install_file = FALSE,
download_dir = tempdir(), silent = FALSE, ...)
updateR(browse_news, install_R, copy_packages, copy_Rprofile.site,
keep_old_packages, update_packages, start_new_R, quit_R,
print_R_versions = TRUE, use_GUI = TRUE, to_checkMD5sums = TRUE,
keep_install_file = FALSE, download_dir = tempdir(), silent = FALSE,
...)
}
\arguments{
\item{browse_news}{if TRUE (and if there is a newer
Expand All @@ -25,6 +26,12 @@ updateR(browse_news, install_R, copy_packages, keep_old_packages,
asked for his preference (he should say yes, unless he is
using a global library folder).}

\item{copy_Rprofile.site}{logical - if to copy your
Rprofile.site from the old version of R to the new
version of R. If missing (this is the default) - the user
will be asked for his preference (he should say yes,
unless he is using a global library folder).}

\item{update_packages}{TRUE/FALSE - if to update your
packages in the new version of R (all packages will be
updated without asking confirmation per package) If
Expand Down

0 comments on commit c22de7e

Please sign in to comment.