diff --git a/DESCRIPTION b/DESCRIPTION index 4178934..5ffb6e7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: Rpacman Type: Package Title: Very simple package manager for R -Version: 1.0.13 -Date: 2022-05-31 +Version: 1.0.14 +Date: 2025-01-30 Authors@R: person("Craig", "Williams", email = "craig@avsdev.uk", role = c("aut", "cre")) URL: https://avsdev.uk/R/Rpacman Description: Very simple package manager for R which allows scanning for used packages, finding their dependencies and versions, creating a lock file and installing the packages on a new build. diff --git a/R/fetch_available_archives.R b/R/fetch_available_archives.R index d9e3201..40513a0 100644 --- a/R/fetch_available_archives.R +++ b/R/fetch_available_archives.R @@ -30,8 +30,8 @@ fn <- ".pacman/archive.rds" dist_fn <- ".pacman/archive_dist.rds" if (file.exists(dist_fn)) { - ts <- as.POSIXct("1970-01-01 00:00:00", tz = "GMT") + as.numeric(Sys.Date() + 1) * 86400 - if (refetch || (ts < file.mtime(dist_fn))) { + ts <- as.POSIXct("1970-01-01 00:00:00", tz = "GMT") + as.numeric(Sys.Date()) * 86400 + if (refetch || (ts > file.mtime(dist_fn))) { unlink(dist_fn) unlink(fn) } diff --git a/R/fetch_available_packages.R b/R/fetch_available_packages.R index f0f8647..0513445 100644 --- a/R/fetch_available_packages.R +++ b/R/fetch_available_packages.R @@ -4,8 +4,8 @@ check_pacman_dir() fn <- ".pacman/packages.rds" if (file.exists(fn)) { - ts <- as.POSIXct("1970-01-01 00:00:00", tz = "GMT") + as.numeric(Sys.Date() + 1) * 86400 - if (refetch || (ts < file.mtime(fn))) { + ts <- as.POSIXct("1970-01-01 00:00:00", tz = "GMT") + as.numeric(Sys.Date()) * 86400 + if (refetch || (ts > file.mtime(fn))) { unlink(fn) } } @@ -38,4 +38,4 @@ fetch_available_packages <- function(refetch = FALSE) { warning = function(e) list(), error = function(e) list() ) -} +} \ No newline at end of file