diff options
| author | Ricardo Wurmus <rekado@elephly.net> | 2025-11-19 15:50:32 +0100 |
|---|---|---|
| committer | Ricardo Wurmus <rekado@elephly.net> | 2025-11-29 12:19:09 +0100 |
| commit | b215cb2027d930b72b43f4d4bb3c090d2c703176 (patch) | |
| tree | f79e1b51541004be0085fe5819f74d6e6498ec38 | |
| parent | ad87b718eda20924b378fcf2d1ea2888a146caa6 (diff) | |
import/cran: Detect library references in "check_installed".
* guix/import/cran.scm (import-pattern): Add case for "check_installed".
* tests/import/cran.scm: Add test.
Change-Id: Id69371158eecaeb371056e6954a3109687346c22
| -rw-r--r-- | guix/import/cran.scm | 2 | ||||
| -rw-r--r-- | tests/import/cran.scm | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/guix/import/cran.scm b/guix/import/cran.scm index b24a732af97..ca194af500b 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -570,7 +570,7 @@ referenced in build system files." ;; Quiet imports "(suppressPackageStartupMessages\\()?" ;; the actual import statement. - "(require|library)\\(\"?([^, \")]+)" + "(require|library|check_installed)\\(\"?([^, \")]+)" ;; Or perhaps... "|" ;; ...direct namespace access. diff --git a/tests/import/cran.scm b/tests/import/cran.scm index 6b1bcc297dd..0b6303370ae 100644 --- a/tests/import/cran.scm +++ b/tests/import/cran.scm @@ -103,6 +103,11 @@ Date/Publication: 2015-07-14 14:15:16 (set->list ((@ (guix import cran) extract-imports) "this:is:not::a:procedure"))) +(test-equal "extract-imports: matches things before a comma" + (list "MASS") + (set->list ((@ (guix import cran) extract-imports) + "check_installed(\"MASS\","))) + (test-equal "r-minimal is not a cran package" #f ((@@ (guix import cran) cran-package?) r-minimal)) |
