Fixed package and archive file timestamp check
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user