[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to show progress for git-fetch method?
From: |
Rodrigo Morales |
Subject: |
How to show progress for git-fetch method? |
Date: |
Mon, 27 Feb 2023 02:30:34 -0500 |
Table of Contents
_________________
1. The context
2. The question
1 The context
=============
Inexperienced user here. I'm currently learning how to write packages
for Guix. I'm using the following package definition.
,----
| (define-module (fonts)
| #:use-module (guix packages)
| #:use-module (guix git-download)
| #:use-module (guix gexp)
| #:use-module (guix build-system trivial)
| #:use-module ((guix licenses) #:prefix license:))
|
| (define-public font-noto-color-emoji
| (package
| (name "font-noto-color-emoji")
| (version "2.034")
| (source (origin
| (method git-fetch)
| (uri (git-reference
| (url "https://github.com/googlefonts/noto-emoji")
| (commit (string-append "v" version))))
| (file-name (git-file-name name version))
| (sha256
| (base32
|
"1d6zzk0ii43iqfnjbldwp8sasyx99lbjp1nfgqjla7ixld6yp98l"))))
| (build-system trivial-build-system)
| (arguments
| (list
| #:modules `((guix build utils))
| #:builder
| #~(begin
| (use-modules (guix build utils))
| (let* ((out #$output)
| (font-dir (string-append out "/share/fonts"))
| (truetype-dir (string-append font-dir "/truetype")))
| (chdir (assoc-ref %build-inputs "source"))
| (install-file "fonts/NotoColorEmoji.ttf" truetype-dir)))))
| (home-page "https://github.com/googlefonts/noto-emoji")
| (synopsis "Noto Color Emoji fonts")
| (description "Noto Color Emoji fonts.")
| (license license:silofl1.1)))
`----
I can install that package without problems, see output of the
following command below.
,----
| date && guix package -i font-noto-color-emoji && date && echo "Exit
code: $?"
`----
,----
| Mon Feb 27 02:17:43 AM -05 2023
| The following package will be installed:
| font-noto-color-emoji 2.034
|
| The following derivations will be built:
| /gnu/store/vlhwjn94rknrnycmawj4h7h6wg3n0gqh-profile.drv
|
/gnu/store/xjrsfz1ca4zphxivmsmz7z7j2xswrrgs-font-noto-color-emoji-2.034.drv
|
/gnu/store/z085zkl49g4pxmd0f7m5izlmlf7429ac-font-noto-color-emoji-2.034-checkout.drv
|
| building
/gnu/store/z085zkl49g4pxmd0f7m5izlmlf7429ac-font-noto-color-emoji-2.034-checkout.drv...
| building
/gnu/store/xjrsfz1ca4zphxivmsmz7z7j2xswrrgs-font-noto-color-emoji-2.034.drv...
| building fonts directory...
| building profile with 22 packages...
| Mon Feb 27 02:18:08 AM -05 2023
| Exit code: 0
`----
As you can see above in the output of the `date' commands, it was a
matter of seconds before the package was installed.
2 The question
=============
Because I'm learning how to write packages for Guix, I reinstall the
package over and over again. Sometimes, the installation takes longer
(for various reason, e.g. internet issues). For this reason, I'd to
know what is happening under the hood during the installation,
especially the progress of file downloads, so is it possible to show a
progress bar for a `git-fetch' method?
Think of this scenario where this might be more useful: One of my
packages download a git repository whose size is bigger than 1GB and
my internet connection is slow, this might take over 1 hour. By seeing
the progress of the download, I wouldn't think that the command got
stuck. I know there are other ways to discard such hypothesis (e.g. using
strace on the process), but I just thought that having a progressbar
would be convenient.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- How to show progress for git-fetch method?,
Rodrigo Morales <=