[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to programmatically get the current channel commits?
From: |
Ludovic Courtès |
Subject: |
Re: How to programmatically get the current channel commits? |
Date: |
Thu, 22 Aug 2019 23:20:04 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
Hi,
Chris Marusich <address@hidden> skribis:
> It's possible to get the current Guix version via %guix-version,
> exported by (guix config). This is useful, among other reasons, for
> embedding in package definitions that produce artifacts that are
> destined to leave the store (e.g., a statically linked program you want
> to ship off somewhere else). Is it possible to programmatically get the
> channel commits currently in use, also?
Recently I added ‘profile-channels’, which does what you want I think:
--8<---------------cut here---------------start------------->8---
$ guix repl
GNU Guile 2.2.4
Copyright (C) 1995-2017 Free Software Foundation, Inc.
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.
Enter `,help' for help.
scheme@(guix-user)> ,use(guix channels)
scheme@(guix-user)> ,use(guix describe)
scheme@(guix-user)> (profile-channels (current-profile))
$1 = (#<<channel> name: guix url: "https://git.savannah.gnu.org/git/guix.git"
branch: "master" commit: "178f1d1f75a8d512b517f474f63da507beaebd49" location:
((line . 549) (column . 19) (filename . "guix/channels.scm"))>)
--8<---------------cut here---------------end--------------->8---
I’d recommend against embedding such metadata into build results by
default, though. See also ‘guix pack --save-provenance’.
HTH!
Ludo’.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: How to programmatically get the current channel commits?,
Ludovic Courtès <=