Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix imagemagick to follow updates.

  • Loading branch information...
commit 4bfa9b0d997b3394c5eb2f50e733b11aec64296d 1 parent 27b2b97
@talgalili authored
Showing with 9 additions and 8 deletions.
  1. +5 −4 R/install.r
  2. +4 −4 R/updateR.r
View
9 R/install.r
@@ -414,7 +414,8 @@ install.ImageMagick <- function(page_with_download_url="http://www.imagemagick.
# get download URL:
page <- readLines(page_with_download_url, warn = FALSE)
# http://www.imagemagick.org/download/binaries/ImageMagick-6.8.3-8-Q16-x86-dll.exe
- pat <- "//www.imagemagick.org/download/binaries/ImageMagick-[0-9.]+-8-Q16-x86-dll.exe";
+ # http://www.imagemagick.org/download/binaries/ImageMagick-6.8.3-9-Q16-x86-dll.exe
+ pat <- "//www.imagemagick.org/download/binaries/ImageMagick-[0-9.]+-[0-9]-Q16-x86-dll.exe";
target_line <- grep(pat, page, value = TRUE);
m <- regexpr(pat, target_line);
URL <- regmatches(target_line, m) # (The http still needs to be prepended.
@@ -451,7 +452,7 @@ install.GraphicsMagick <- function(page_with_download_url="http://sourceforge.n
page <- readLines(page_with_download_url, warn = FALSE)
# http://downloads.sourceforge.net/project/graphicsmagick/graphicsmagick-binaries/1.3.17/GraphicsMagick-1.3.17-Q16-windows-dll.exe?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fgraphicsmagick%2Ffiles%2F&ts=1362862824&use_mirror=garr
# http://sourceforge.net/projects/graphicsmagick/files/graphicsmagick-binaries/1.3.17/GraphicsMagick-1.3.17-Q8-windows-dll.exe/download
- pat <- "//sourceforge.net/projects/graphicsmagick/files/graphicsmagick-binaries/[0-9.]+/GraphicsMagick-[0-9.]+-Q16-windows-dll.exe"
+ pat <- "//sourceforge.net/projects/graphicsmagick/files/graphicsmagick-binaries/[0-9.]+/GraphicsMagick-[0-9.]+-Q16-windows-dll.exe"
target_line <- grep(pat, page, value = TRUE);
m <- regexpr(pat, target_line);
URL <- regmatches(target_line, m) # (The http still needs to be prepended.
@@ -593,7 +594,7 @@ shutdown = function(s=0, m=0, h=0) {
#' installr()
#' }
installr <- function(use_GUI = TRUE, ...) {
- choices <- c("R",
+ choices <- c("R (updateR)",
"RStudio",
"Rtools",
"git",
@@ -607,7 +608,7 @@ installr <- function(use_GUI = TRUE, ...) {
the_answer <- menu(choices, graphics = use_GUI, title = "Which software (for Windows) would you like to install?")
switch(the_answer,
- install.R(),
+ updateR(),
install.RStudio(),
install.Rtools(),
install.git(),
View
8 R/updateR.r
@@ -273,7 +273,7 @@ get.installed.R.folders <- function(sort_by_version = T, add_version_to_name = T
#' copy.packages.between.libraries(ask = T) # it will ask you from what R version to copy the packages into which R version. Since (do_NOT_override_packages_in_new_R = T) the function will make sure to NOT override your newer packages.
#' # copy.packages.between.libraries(ask = T, keep_old = F) # As before, but this time it will MOVE (instead of COPY) the packages. e.g: erase them from their old location.
#' }
-copy.packages.between.libraries <- function(from, to, ask =F,keep_old = T, do_NOT_override_packages_in_new_R = T) {
+copy.packages.between.libraries <- function(from, to, ask =FALSE,keep_old = TRUE, do_NOT_override_packages_in_new_R = TRUE) {
installed_R_folders <- get.installed.R.folders()
installed_R_folders_TABLE <-data.frame("R_version" = names(installed_R_folders) , Folder = installed_R_folders)
@@ -299,8 +299,8 @@ copy.packages.between.libraries <- function(from, to, ask =F,keep_old = T, do_NO
}
}
- if(missing(to)) to <- installed_R_folders[1] # copy inTO the newest R
if(missing(from)) from <- installed_R_folders[2] # copy FROM the one version before newest R
+ if(missing(to)) to <- installed_R_folders[1] # copy inTO the newest R
# the libraries
from_library <- file.path(from , "library")
@@ -333,7 +333,7 @@ copy.packages.between.libraries <- function(from, to, ask =F,keep_old = T, do_NO
packages_to_YES_move_from
folders.copied <- file.copy(from = paths_of_packages_to_copy_from, # copy folders
to = to_library,
- overwrite = TRUE,
+ overwrite = !do_NOT_override_packages_in_new_R, # to be SURE that an old library will not override a new one.
recursive =TRUE)
cat("=====================","\n")
cat("Done. We finished copying all the packages to the new location\n")
@@ -381,7 +381,7 @@ copy.packages.between.libraries <- function(from, to, ask =F,keep_old = T, do_NO
#' updateR(T, T, T, T, T, T, T) # the safest upgrade option: See the NEWS, install R, copy packages, keep old packages, update packages in the new installation, start the Rgui of the new R, and quite current session of R
#' 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=T, use_GUI = TRUE, ...) {
+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, ...) {
# this function checks if we have the latest version of R
# IF not - it notifies the user - and leaves.
# If there is a new version - it offers the user to download and install it.
Please sign in to comment.
Something went wrong with that request. Please try again.