From 50efafaaafa0d59e6506133b1407dcc419893d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Fri, 8 Nov 2024 10:33:48 +0100 Subject: [PATCH] deps:: defaults to package inside packages Otherwise it scans dependencies. --- R/type-deps.R | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/R/type-deps.R b/R/type-deps.R index 45810bb5..9a05d25c 100644 --- a/R/type-deps.R +++ b/R/type-deps.R @@ -14,7 +14,8 @@ parse_remote_deps <- function(specs, config, ...) { resolve_remote_deps <- function(remote, direct, config, cache, dependencies, ...) { - if (file.exists(file.path(remote$path, "DESCRIPTION"))) { + in_pkg <- tryCatch(find_package_root(remote$path), error = function(x) NULL) + if (!is.null(in_pkg)) { ret <- resolve_remote_local(remote, direct, config, cache, dependencies, ...) } else { @@ -67,6 +68,12 @@ resolve_remote_local_autodeps <- function(remote, direct, config, cache, dsc <- desc::desc("!new") hard <- deps$package[deps$type == "prod"] soft <- deps$package[deps$type != "prod"] + dsc$set( + Package = "localprojectautoscan", + Version = "1.0.0", + Title = "Local Project", + License = "Unknown" + ) for (p in hard) dsc$set_dep(p, type = "Depends") for (s in soft) dsc$set_dep(p, type = "Suggests") dsc$write(tmpdesc)