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." | |||
| 570 | ;; Quiet imports | 570 | ;; Quiet imports |
| 571 | "(suppressPackageStartupMessages\\()?" | 571 | "(suppressPackageStartupMessages\\()?" |
| 572 | ;; the actual import statement. | 572 | ;; the actual import statement. |
| 573 | "(require|library)\\(\"?([^, \")]+)" | 573 | "(require|library|check_installed)\\(\"?([^, \")]+)" |
| 574 | ;; Or perhaps... | 574 | ;; Or perhaps... |
| 575 | "|" | 575 | "|" |
| 576 | ;; ...direct namespace access. | 576 | ;; ...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 | |||
| 103 | (set->list ((@ (guix import cran) extract-imports) | 103 | (set->list ((@ (guix import cran) extract-imports) |
| 104 | "this:is:not::a:procedure"))) | 104 | "this:is:not::a:procedure"))) |
| 105 | 105 | ||
| 106 | (test-equal "extract-imports: matches things before a comma" | ||
| 107 | (list "MASS") | ||
| 108 | (set->list ((@ (guix import cran) extract-imports) | ||
| 109 | "check_installed(\"MASS\","))) | ||
| 110 | |||
| 106 | (test-equal "r-minimal is not a cran package" | 111 | (test-equal "r-minimal is not a cran package" |
| 107 | #f | 112 | #f |
| 108 | ((@@ (guix import cran) cran-package?) r-minimal)) | 113 | ((@@ (guix import cran) cran-package?) r-minimal)) |
