Fixed package and archive file timestamp check

This commit is contained in:
2025-01-30 11:29:10 +00:00
parent 8773ddb195
commit 36f6ef2020
3 changed files with 7 additions and 7 deletions

View File

@@ -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.

View File

@@ -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)
}

View File

@@ -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)
}
}