* Listing the files of a package output
@ 2023-06-20 13:18 Konrad Hinsen
2023-06-20 16:53 ` Guillaume Le Vaillant
0 siblings, 1 reply; 3+ messages in thread
From: Konrad Hinsen @ 2023-06-20 13:18 UTC (permalink / raw)
To: help-guix
Hi Guix,
this looks like a beginner's question, but I can't figure out how to do
this: list the files in a given package output, from the command line (I
do know how to do this in Guile).
For a package with a single output, I can do
ls -R $(guix build hello)
For a package output other than "out", I can do
ls -R $(guix build coreutils | grep debug)
But what about coreutils:out?
Cheers,
Konrad
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Listing the files of a package output
2023-06-20 13:18 Listing the files of a package output Konrad Hinsen
@ 2023-06-20 16:53 ` Guillaume Le Vaillant
2023-06-20 19:35 ` Konrad Hinsen
0 siblings, 1 reply; 3+ messages in thread
From: Guillaume Le Vaillant @ 2023-06-20 16:53 UTC (permalink / raw)
To: Konrad Hinsen; +Cc: help-guix
[-- Attachment #1: Type: text/plain, Size: 866 bytes --]
Konrad Hinsen <konrad.hinsen@fastmail.net> skribis:
> Hi Guix,
>
> this looks like a beginner's question, but I can't figure out how to do
> this: list the files in a given package output, from the command line (I
> do know how to do this in Guile).
>
> For a package with a single output, I can do
>
> ls -R $(guix build hello)
>
> For a package output other than "out", I can do
>
> ls -R $(guix build coreutils | grep debug)
>
> But what about coreutils:out?
>
> Cheers,
> Konrad
Hi.
As the directory of the "out" output will have a shorter name, you could
sort the names by size and take the first one:
--8<---------------cut here---------------start------------->8---
for name in $(guix build coreutils); do printf "%d\t%s\n" "${#name}" "${name}"; done | sort -n | head -n 1 | cut -f 2
--8<---------------cut here---------------end--------------->8---
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Listing the files of a package output
2023-06-20 16:53 ` Guillaume Le Vaillant
@ 2023-06-20 19:35 ` Konrad Hinsen
0 siblings, 0 replies; 3+ messages in thread
From: Konrad Hinsen @ 2023-06-20 19:35 UTC (permalink / raw)
To: Guillaume Le Vaillant; +Cc: help-guix
Hi Guillaume,
> As the directory of the "out" output will have a shorter name, you could
> sort the names by size and take the first one:
>
> --8<---------------cut here---------------start------------->8---
> for name in $(guix build coreutils); do printf "%d\t%s\n" "${#name}" "${name}"; done | sort -n | head -n 1 | cut -f 2
> --8<---------------cut here---------------end--------------->8---
Indeed, thanks! A but lengthy by my taste, but it does the job!
Cheers,
Konrad.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-20 19:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-20 13:18 Listing the files of a package output Konrad Hinsen
2023-06-20 16:53 ` Guillaume Le Vaillant
2023-06-20 19:35 ` Konrad Hinsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).