From 7833c101c216dc3bf7779f24042208b34974b772 Mon Sep 17 00:00:00 2001 From: pat-s Date: Wed, 20 Nov 2024 20:19:28 +0100 Subject: [PATCH] add `range` arg to list pkgs without binaries --- local/packages-without-binaries.R | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/local/packages-without-binaries.R b/local/packages-without-binaries.R index 01640de..8709056 100644 --- a/local/packages-without-binaries.R +++ b/local/packages-without-binaries.R @@ -71,24 +71,26 @@ df_summary <- df_missing_pkgs %>% count() # Extract and copy missing package names for each architecture and ID combination -extract_and_copy_pkgs <- function(df, arch, id, clip = FALSE) { +extract_and_copy_pkgs <- function(df, arch, range = 300, id, clip = FALSE) { pkgs <- df %>% filter(arch == arch, ID == id) %>% pull(pkg_name) - # Print and copy to clipboard if needed - formatted_pkgs <- gsub('"', "'", capture.output(dput(pkgs[1:300]))) - cat(formatted_pkgs, "\n", sep = "") - + # Format, remove line breaks, and print as a single line + formatted_pkgs <- gsub('"', "'", capture.output(dput(pkgs[1:range]))) + formatted_pkgs_one_line <- paste(formatted_pkgs, collapse = " ") + + cat(formatted_pkgs_one_line, "\n", sep = "") + if (clip) { - clipr::write_clip(formatted_pkgs) + clipr::write_clip(formatted_pkgs_one_line) } return(pkgs) } # Usage for different architecture and ID combinations -pkgs_missing_amd64_rhel8 <- extract_and_copy_pkgs(df_missing_pkgs, "amd64", "rhel8", clip = TRUE) +pkgs_missing_amd64_rhel8 <- extract_and_copy_pkgs(df_missing_pkgs, "amd64", "rhel8", range = 20, clip = TRUE) pkgs_missing_amd64_rhel9 <- extract_and_copy_pkgs(df_missing_pkgs, "amd64", "rhel9", clip = TRUE) pkgs_missing_amd64_jammy <- extract_and_copy_pkgs(df_missing_pkgs, "amd64", "jammy", clip = TRUE) pkgs_missing_amd64_noble <- extract_and_copy_pkgs(df_missing_pkgs, "amd64", "noble", clip = TRUE)