Skip to content

Commit

Permalink
drop the dependency on archive v0.21.0
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondben committed Jan 18, 2024
1 parent 485ab44 commit 14d80e1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ovideo
Title: Volleyball Video Utilities
Version: 0.20.2
Version: 0.21.0
Authors@R: c(person(given = "Ben", family = "Raymond", role = c("aut", "cre"), email = "[email protected]"),
person(given = "Adrien", family = "Ickowicz", role = "aut"),
person("openvolley.org", role = "org"))
Expand All @@ -13,7 +13,6 @@ LazyData: true
Roxygen: list(markdown = TRUE)
Depends: datavolley (> 0.12.999)
Imports:
archive,
assertthat,
av,
base64enc,
Expand Down
2 changes: 1 addition & 1 deletion R/install_ffmpeg.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ov_install_ffmpeg <- function(force = FALSE, bits, check_hash = TRUE) {
if (grepl("\\.zip$", zipname, ignore.case = TRUE)) {
utils::unzip(zipname, exdir = path)
} else {
archive::archive_extract(zipname, dir = path)
extract_txz(zipname, exdir = path)
}
}
## now we should see the executable
Expand Down
9 changes: 9 additions & 0 deletions R/internal_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,12 @@ twitch_url_to_id <- function(z) {
str_first_upper <- function(x) {
paste0(toupper(substr(x, 1, 1)), tolower(substr(x, 2, nchar(x))))
}

## extract a .tar.xz file without using archive pkg
extract_txz <- function(txzfile, exdir) {
if (!dir.exists(exdir)) stop("exdir must exist")
tf <- tempfile(fileext = ".tar")
on.exit(unlink(tf))
writeBin(memDecompress(readBin(txzfile, what = "raw", n = file.size(txzfile) * 1.2), type = "xz"), con = tf)
utils::untar(tf, exdir = fs::path_real(exdir))
}

0 comments on commit 14d80e1

Please sign in to comment.