Commit Graph

15 Commits

Author SHA1 Message Date
Ludovic Courtès 8a154c2915
describe: Gracefully handle profiles that lack provenance info.
Fixes <https://bugs.gnu.org/48313>.

Previously, 'current-channels' would return the empty list when
'current-profile' is true but the profile lacks provenance info.

* guix/describe.scm (current-channels)[build-time-metadata]: New
procedure.  Call it when 'manifest-entry-channel' returns #f for all of
ENTRIES.
* guix/scripts/describe.scm (guix-describe): When PROFILE is true, pass
third argument to 'display-profile-info'.
2021-05-09 23:46:46 +02:00
Mathieu Othacehe 4dfce0115f
describe: Make sure package-channels always returns a list.
* guix/describe.scm (package-channels): Return an empty list if the file
origin could not be determined.
2021-02-25 10:24:11 +01:00
Mathieu Othacehe b6c7e5af02
describe: Add missing include.
This is a follow-up of 17fbd5a5c9.

* guix/describe.scm: Add "channel-name" to (guix channels) autoload.
2021-02-25 10:19:32 +01:00
Mathieu Othacehe 17fbd5a5c9
describe: Add package-channels.
* guix/describe.scm (package-channels): New procedure.
(package-provenance): Rewrite using package-channels procedure.
2021-02-25 10:11:25 +01:00
Ludovic Courtès ce2ba3431a
describe: Fix typo in 'manifest-entry-with-provenance'.
* guix/describe.scm (manifest-entry-with-provenance): Fix first argument
to 'assq'.
2021-02-22 23:42:08 +01:00
Ludovic Courtès 316fc2acbb
channels: Record 'guix' channel metadata in (guix config).
Partially fixes <https://bugs.gnu.org/45896>.

* guix/config.scm.in (%channel-metadata): New variable.
* guix/describe.scm (channel-metadata): Use it.
(current-channels): New procedure.
(current-profile-entries): Clarify docstring.
* guix/self.scm (compiled-guix): Add #:channel-metadata and pass it to
'make-config.scm'.
(make-config.scm): Add #:channel-metadata and define '%channel-metadata'
in the generated file.
(guix-derivation): Add #:channel-metadata and pass it to 'compiled-guix'.
* guix/channels.scm (build-from-source): Replace 'name', 'source', and
'commit' parameters with 'instance'.  Pass #:channel-metadata to BUILD.
(build-channel-instance): Adjust accordingly.
* build-aux/build-self.scm (build-program): Add #:channel-metadata
and pass it to 'guix-derivation'.
(build): Add #:channel-metadata and pass it to 'build-program'.
* guix/scripts/describe.scm (display-profile-info): Add optional
'channels' parameter.  Pass it to 'display-profile-content'.
(display-profile-content): Add optional 'channels' parameter and honor
it.  Iterate on CHANNELS rather than on the manifest entries of
PROFILE.
(guix-describe): When PROFILE is #f, call 'current-channels' and pass it
to 'display-profile-info', unless it returns the empty list.
2021-02-04 09:23:39 +01:00
Ludovic Courtès aedbc5ff32
guix package: Add '--export-channels'.
* guix/channels.scm (sexp->channel): Export.
* guix/describe.scm: Use (guix channels).
(manifest-entry-provenance): New procedure.
* guix/scripts/package.scm (channel=?, export-channels): New
procedures.
(show-help, %options): Add '--export-channels'.
(process-query): Honor it.
* build-aux/build-self.scm (build-program)[select?]: Exclude (guix
channels) to account for the (guix describe) change above.
* doc/guix.texi (Invoking guix package): Document it.
2021-02-01 17:32:35 +01:00
Ludovic Courtès 1b179d7876
describe: Save the original value of (program-arguments).
Fixes <https://bugs.gnu.org/42688>.
Reported by pkill9 <pkill9@runbox.com>.

This ensures that 'guix repl -s SCRIPT' give SCRIPT the right value
of (current-profile), which in turn ensures that (%package-module-path)
is initialized with the right set of channels.

* guix/describe.scm (initial-program-arguments): New variable.
(current-profile): Use it.
* guix/scripts/repl.scm (guix-repl): Call 'current-profile' before
'set-program-arguments'.
2020-09-19 22:52:36 +02:00
Ludovic Courtès c48e522fdb
guix package: Save provenance information when using '--manifest'.
Fixes <https://bugs.gnu.org/38673>.
Reported by zimoun <zimon.toutoune@gmail.com>.

* guix/describe.scm (manifest-entry-with-provenance): New procedure.
* guix/scripts/package.scm (process-actions): Use it when FILES is
non-empty.
2019-12-29 18:24:54 +01:00
Ludovic Courtès cd2e4b2a8d
describe: Add 'current-profile-date'.
* guix/describe.scm (current-profile-date): New procedure.
2019-03-17 22:55:01 +01:00
Ludovic Courtès 3f4f2ee404
describe: 'package-path-entries' no longer includes the "guix" entry.
Fixes <https://bugs.gnu.org/34833>
Reported by mikadoZero <mikadozero@yandex.com>.

By returning the "guix" entry, we were then adding it to
%PACKAGE-MODULE-PATH, causing the discovery code to scan the whole tree,
including gnu/installer modules, which would in turn lead to warnings.
Regression introduced in bfc9c33930.

* guix/describe.scm (package-path-entries): Use
'current-channel-entries', not 'current-profile-entries'.
2019-03-12 23:51:32 +01:00
Ludovic Courtès bfc9c33930
packages: Add the channel .go files to the search path.
Until now %LOAD-COMPILED-PATH would wrongfully contain:

  CHANNEL/share/guile/site/X.Y

for each channel, thereby ignoring all the .go files of channels.  This
fixes it so that %LOAD-COMPILED-PATH instead contains:

  CHANNEL/lib/guile/X.Y/site-ccache

* guix/describe.scm (current-channel-entries): New procedure.
(package-path-entries): Change to return the %LOAD-COMPILED-PATH entries
as a second value.
* gnu/packages.scm (%package-module-path): Expect two values from
'package-path-entries' and augment %LOAD-COMPILED-PATH accordingly.
2019-03-11 23:12:26 +01:00
Ludovic Courtès 2cb658a9a7
describe: Add 'package-provenance'.
* guix/scripts/package.scm (package-provenance): Move to...
* guix/describe.scm (package-provenance): ... here.
2019-03-07 00:00:18 +01:00
Ludovic Courtès bd7470185b
Add 'guix describe'.
* guix/scripts/describe.scm: New file.
* Makefile.am (MODULES): Add it.
(SH_TESTS): Add tests/guix-describe.sh.
* po/guix/POTFILES.in: Add it.
* guix/scripts/pull.scm (display-profile-content): Export.
* guix/describe.scm (current-profile, current-profile-entries): Export.
* tests/guix-describe.sh: New file.
* doc/guix.texi (Features): Mention 'guix pull' and provenance tracking.
(Invoking guix pull): Link to 'guix describe'.
(Channels): Likewise.
(Invoking guix describe): New node.
2018-09-07 11:40:22 +02:00
Ludovic Courtès fe634eaf93
Add (guix describe) and use it to initialize '%package-search-path'.
* guix/describe.scm: New file.
* Makefile.am (MODULES): Add it.
* gnu/packages.scm (%default-package-module-path): New variable.
(%package-module-path): Honor 'package-path-entries'.
* build-aux/update-NEWS.scm (main): Use %DEFAULT-PACKAGE-MODULE-PATH
instead of (last (%package-module-path)).
2018-09-02 16:43:10 +02:00