diff options
author | Ludovic Courtès <ludo@gnu.org> | 2023-05-28 22:44:52 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2023-05-31 23:25:26 +0200 |
commit | 57ceb64e3464c347f42bd883e394163904f928ec (patch) | |
tree | a6174d355bef31c2cc4441b754d0159ad8f4690e /guix/upstream.scm | |
parent | 9e237fe0bd813664adf54599586df75b2e5b0998 (diff) |
upstream: Honor package properties for ignored and extra inputs.
* guix/upstream.scm (update-package-inputs)[filtered-inputs]
[regular-inputs, native-inputs, propagated-inputs]: New procedures.
Use them in 'update-field' calls.
* tests/guix-refresh.sh (GUIX_TEST_UPDATER_TARGETS): Add "libreoffice"
to the dependencies of "the-test-package". Add 'updater-ignored-inputs'
property to "the-test-package".
* doc/guix.texi (Invoking guix refresh): Document it.
Diffstat (limited to 'guix/upstream.scm')
-rw-r--r-- | guix/upstream.scm | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/guix/upstream.scm b/guix/upstream.scm index 53e473715c..33248d645c 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -557,11 +557,44 @@ specified in SOURCE, an <upstream-source>." (G_ "~a: expected '~a' value: ~s~%") (package-name package) field new)))) + (define (filtered-inputs source-inputs extra-property ignore-property) + ;; Return a procedure that behaves like SOURCE-INPUTS but additionally + ;; honors EXTRA-PROPERTY and IGNORE-PROPERTY from PACKAGE. + (lambda (source) + (let* ((inputs (source-inputs source)) + (properties (package-properties package)) + (ignore (or (assoc-ref properties ignore-property) '())) + (extra (or (assoc-ref properties extra-property) '()))) + (append (if (null? ignore) + inputs + (remove (lambda (input) + (member (upstream-input-downstream-name input) + ignore)) + inputs)) + (map (lambda (name) + (upstream-input + (name name) + (downstream-name name))) + extra))))) + + (define regular-inputs + (filtered-inputs upstream-source-regular-inputs + 'updater-extra-inputs + 'updater-ignored-inputs)) + (define native-inputs + (filtered-inputs upstream-source-native-inputs + 'updater-extra-native-inputs + 'updater-ignored-native-inputs)) + (define propagated-inputs + (filtered-inputs upstream-source-propagated-inputs + 'updater-extra-propagated-inputs + 'updater-ignored-propagated-inputs)) + (for-each update-field '(inputs native-inputs propagated-inputs) - (list upstream-source-regular-inputs - upstream-source-native-inputs - upstream-source-propagated-inputs) + (list regular-inputs + native-inputs + propagated-inputs) (list package-inputs package-native-inputs package-propagated-inputs))) |