M ChangeLog => ChangeLog +4 -0
@@ 1,3 1,7 @@
+2023-10-16 Enrico Schumann <es@enricoschumann.net>
+
+ * R/functions.R (latest_version): simplify regexp
+
2023-09-07 Enrico Schumann <es@enricoschumann.net>
* DESCRIPTION (Version): 0.3.4
M DESCRIPTION => DESCRIPTION +1 -1
@@ 2,7 2,7 @@ Package: esutils
Type: Package
Title: esutils
Version: 0.3.4
-Date: 2023-09-07
+Date: 2023-10-16
Maintainer: Enrico Schumann <es@enricoschumann.net>
Authors@R: person(given = "Enrico", family = "Schumann",
role = c("aut", "cre"),
M R/functions.R => R/functions.R +1 -2
@@ 221,8 221,7 @@ function(pkg, path = ".", type = "source", strict = TRUE) {
else if (type == "binary" || type == "zip")
ext <- "[.]zip$"
all_p <- dir(path, pattern = paste0(pkg, "_.*", ext))
- all_v <- gsub(paste0(".*_([0-9]+[-.][0-9]+[-.][0-9]+)", ext),
- "\\1", all_p)
+ all_v <- gsub(paste0("[^_]+_(.*)", ext), "\\1", all_p)
all_v <- package_version(all_v, strict = strict)
all_p[max(all_v) == all_v]
}