Rev 87618 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
### tests of compressiin on un(tar)options(warn = 1)old <- getwd()for(f in c("none", "gzip", "bzip2", "xz", "zstd")){setwd(R.home('library'))z <- if (f=="none") "utils.tar" else paste0("utils.tar.", f)zz <- file.path(old, z)message("making ", z)## zstd support is optionaly <- try(tar(zz, "utils", f))if(inherits(y, "try-error")) nextprint(file.size(zz))setwd(old)print(head(untar(zz, list = TRUE, tar = "internal")))untar(zz, tar = "internal")}## Now try external untar : skip on Windows due to different handling of pathsif(.Platform$OS.type == "windows") {unlink("utils", recursive = TRUE)quit("no")}for(f in c("none", "gzip", "bzip2", "xz", "zstd")){z <- if (f=="none") "utils.tar" else paste0("utils.tar.", f)if (!file.exists(z)) nextmessage("unpacking ", z)y <- untar(z)if(inherits(y, "try-error")) nextprint(head(dir("utils"), 5))}## and external tarTAR <- Sys.getenv("TAR", "tar")for(f in c("none", "gzip", "bzip2", "xz", "zstd")){setwd(R.home('library'))z <- if (f=="none") "utils.tar" else paste0("utils.tar.", f)zz <- file.path(old, z)message("making ", z)y <- try(tar(zz, "utils", f, tar = TAR))if(inherits(y, "try-error")) nextprint(file.size(zz))setwd(old)}unlink("utils", recursive = TRUE)