guix package: -A and -s take supported systems into account.
* guix/scripts/package.scm (guix-package)[process-query] <list-available>: Restrict results to packages matching 'supported-package?". * guix/ui.scm (package->recutils): Print "systems:". * tests/guix-package.sh: Add tests. * doc/guix.texi (Invoking guix package): Adjust description of '--list-available' accordingly.
This commit is contained in:
parent
bbceb0ef8a
commit
5763ad9266
|
@ -1105,7 +1105,7 @@ availability of packages:
|
||||||
|
|
||||||
@item --search=@var{regexp}
|
@item --search=@var{regexp}
|
||||||
@itemx -s @var{regexp}
|
@itemx -s @var{regexp}
|
||||||
List the available packages whose synopsis or description matches
|
List the available packages whose name, synopsis, or description matches
|
||||||
@var{regexp}. Print all the meta-data of matching packages in
|
@var{regexp}. Print all the meta-data of matching packages in
|
||||||
@code{recutils} format (@pxref{Top, GNU recutils databases,, recutils,
|
@code{recutils} format (@pxref{Top, GNU recutils databases,, recutils,
|
||||||
GNU recutils manual}).
|
GNU recutils manual}).
|
||||||
|
@ -1171,7 +1171,7 @@ the store.
|
||||||
|
|
||||||
@item --list-available[=@var{regexp}]
|
@item --list-available[=@var{regexp}]
|
||||||
@itemx -A [@var{regexp}]
|
@itemx -A [@var{regexp}]
|
||||||
List packages currently available in the software distribution
|
List packages currently available in the distribution for this system
|
||||||
(@pxref{GNU Distribution}). When @var{regexp} is specified, list only
|
(@pxref{GNU Distribution}). When @var{regexp} is specified, list only
|
||||||
installed packages whose name matches @var{regexp}.
|
installed packages whose name matches @var{regexp}.
|
||||||
|
|
||||||
|
|
|
@ -960,11 +960,13 @@ more information.~%"))
|
||||||
(available (fold-packages
|
(available (fold-packages
|
||||||
(lambda (p r)
|
(lambda (p r)
|
||||||
(let ((n (package-name p)))
|
(let ((n (package-name p)))
|
||||||
(if regexp
|
(if (supported-package? p)
|
||||||
(if (regexp-exec regexp n)
|
(if regexp
|
||||||
(cons p r)
|
(if (regexp-exec regexp n)
|
||||||
r)
|
(cons p r)
|
||||||
(cons p r))))
|
r)
|
||||||
|
(cons p r))
|
||||||
|
r)))
|
||||||
'())))
|
'())))
|
||||||
(leave-on-EPIPE
|
(leave-on-EPIPE
|
||||||
(for-each (lambda (p)
|
(for-each (lambda (p)
|
||||||
|
|
|
@ -653,6 +653,8 @@ WIDTH columns."
|
||||||
;; Note: Don't i18n field names so that people can post-process it.
|
;; Note: Don't i18n field names so that people can post-process it.
|
||||||
(format port "name: ~a~%" (package-name p))
|
(format port "name: ~a~%" (package-name p))
|
||||||
(format port "version: ~a~%" (package-version p))
|
(format port "version: ~a~%" (package-version p))
|
||||||
|
(format port "systems: ~a~%"
|
||||||
|
(string-join (package-transitive-supported-systems p)))
|
||||||
(format port "dependencies: ~a~%"
|
(format port "dependencies: ~a~%"
|
||||||
(match (package-direct-inputs p)
|
(match (package-direct-inputs p)
|
||||||
(((labels inputs . _) ...)
|
(((labels inputs . _) ...)
|
||||||
|
|
|
@ -212,9 +212,19 @@ cat > "$module_dir/foo.scm"<<EOF
|
||||||
(patches (list (search-patch "emacs.patch")))))
|
(patches (list (search-patch "emacs.patch")))))
|
||||||
(name "emacs-foo-bar-patched")
|
(name "emacs-foo-bar-patched")
|
||||||
(version "42")))
|
(version "42")))
|
||||||
|
|
||||||
|
(define-public y
|
||||||
|
(package (inherit emacs)
|
||||||
|
(name "super-non-portable-emacs")
|
||||||
|
(supported-systems '("foobar64-hurd"))))
|
||||||
EOF
|
EOF
|
||||||
guix package -i emacs-foo-bar-patched -n
|
guix package -i emacs-foo-bar-patched -n
|
||||||
|
|
||||||
|
# This one should not show up in searches since it's no supported on the
|
||||||
|
# current system.
|
||||||
|
test "`guix package -A super-non-portable-emacs`" = ""
|
||||||
|
test "`guix package -s super-non-portable-emacs | grep ^systems:`" = "systems: "
|
||||||
|
|
||||||
unset GUIX_PACKAGE_PATH
|
unset GUIX_PACKAGE_PATH
|
||||||
|
|
||||||
# Using 'GUIX_BUILD_OPTIONS'.
|
# Using 'GUIX_BUILD_OPTIONS'.
|
||||||
|
|
Loading…
Reference in New Issue