diff options
author | Marius Bakke <marius@gnu.org> | 2021-05-09 21:29:46 +0200 |
---|---|---|
committer | Marius Bakke <marius@gnu.org> | 2021-05-09 21:29:46 +0200 |
commit | f03426420497cd9839f5fb3cb547dbecd8d6053b (patch) | |
tree | 220cdbab5b58b27c63d2df3ee711ad4bfdda074b /etc | |
parent | 3cf1afb7e7249992b2db2f4f00899fd22237e89a (diff) | |
parent | 069399ee9dbf75b7c89583f03346a63b2cfe4ac6 (diff) | |
download | guix-f03426420497cd9839f5fb3cb547dbecd8d6053b.tar.gz guix-f03426420497cd9839f5fb3cb547dbecd8d6053b.zip |
Merge branch 'master' into core-updates
Conflicts:
gnu/local.mk
gnu/packages/bioinformatics.scm
gnu/packages/django.scm
gnu/packages/gtk.scm
gnu/packages/llvm.scm
gnu/packages/python-web.scm
gnu/packages/python.scm
gnu/packages/tex.scm
guix/build-system/asdf.scm
guix/build/emacs-build-system.scm
guix/profiles.scm
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/committer.scm.in | 52 | ||||
-rw-r--r-- | etc/completion/fish/guix.fish | 2 | ||||
-rwxr-xr-x | etc/guix-install.sh | 45 |
3 files changed, 73 insertions, 26 deletions
diff --git a/etc/committer.scm.in b/etc/committer.scm.in index 1f19ccfd6d..96cd1fbf0b 100755 --- a/etc/committer.scm.in +++ b/etc/committer.scm.in @@ -38,6 +38,33 @@ (ice-9 rdelim) (ice-9 textual-ports)) +(define* (break-string str #:optional (max-line-length 70)) + "Break the string STR into lines that are no longer than MAX-LINE-LENGTH. +Return a single string." + (define (restore-line words) + (string-join (reverse words) " ")) + (if (<= (string-length str) max-line-length) + str + (let ((words+lengths (map (lambda (word) + (cons word (string-length word))) + (string-tokenize str)))) + (match (fold (match-lambda* + (((word . length) + (count current lines)) + (let ((new-count (+ count length 1))) + (if (< new-count max-line-length) + (list new-count + (cons word current) + lines) + (list length + (list word) + (cons (restore-line current) lines)))))) + '(0 () ()) + words+lengths) + ((_ last-words lines) + (string-join (reverse (cons (restore-line last-words) lines)) + "\n")))))) + (define (read-excursion port) "Read an expression from PORT and reset the port position before returning the expression." @@ -204,18 +231,19 @@ corresponding to the top-level definition containing the staged changes." (added (lset-difference equal? new-values old-values))) (format port "[~a]: ~a~%" field - (match (list (map symbol->string removed) - (map symbol->string added)) - ((() added) - (format #f "Add ~a." - (listify added))) - ((removed ()) - (format #f "Remove ~a." - (listify removed))) - ((removed added) - (format #f "Remove ~a; add ~a." - (listify removed) - (listify added))))))))) + (break-string + (match (list (map symbol->string removed) + (map symbol->string added)) + ((() added) + (format #f "Add ~a." + (listify added))) + ((removed ()) + (format #f "Remove ~a." + (listify removed))) + ((removed added) + (format #f "Remove ~a; add ~a." + (listify removed) + (listify added)))))))))) '(inputs propagated-inputs native-inputs))) (define* (add-commit-message file-name variable-name #:optional (port (current-output-port))) diff --git a/etc/completion/fish/guix.fish b/etc/completion/fish/guix.fish index 422baab4bb..8d1a1eb1e9 100644 --- a/etc/completion/fish/guix.fish +++ b/etc/completion/fish/guix.fish @@ -322,8 +322,6 @@ complete -f -c guix -n '__fish_guix_needs_command' -a import -d 'Run IMPORTER wi ##### import gnu complete -f -c guix -n '__fish_guix_using_command import; and not __fish_seen_subcommand_from $remotecommands' -a gnu -d 'Return a package declaration template for PACKAGE, a GNU package.' complete -f -c guix -n '__fish_guix_using_command import; and __fish_seen_subcommand_from gnu' -a "--key-download=" -d 'handle missing OpenPGP keys according to POLICY: "always", "never", and "interactive", which is also used when "key-download" is not specified.' -##### import nix -complete -f -c guix -n '__fish_guix_using_command import; and not __fish_seen_subcommand_from $remotecommands' -a nix -d 'Import and convert the Nix expression ATTRIBUTE of NIXPKGS.' ##### import pypi complete -f -c guix -n '__fish_guix_using_command import; and not __fish_seen_subcommand_from $remotecommands' -a pypi -d 'Import and convert the PyPI package for PACKAGE-NAME.' ##### import cpan diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 949ef7719f..06a3edd1a6 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -64,7 +64,12 @@ INF="[ INFO ] " DEBUG=0 GNU_URL="https://ftp.gnu.org/gnu/guix/" #GNU_URL="https://alpha.gnu.org/gnu/guix/" -OPENPGP_SIGNING_KEY_ID="3CE464558A84FDC69DB40CFB090B11993D9AEBB5" + +# The following associative array holds set of GPG keys used to sign the +# releases, keyed by their corresponding Savannah user ID. +declare -A GPG_SIGNING_KEYS +GPG_SIGNING_KEYS[15145]=3CE464558A84FDC69DB40CFB090B11993D9AEBB5 # ludo +GPG_SIGNING_KEYS[127547]=27D586A4F8900854329FF09F1260E46482E63562 # maxim # This script needs to know where root's home directory is. However, we # cannot simply use the HOME environment variable, since there is no guarantee @@ -113,14 +118,21 @@ chk_require() chk_gpg_keyring() { # Check whether the Guix release signing public key is present. _debug "--- [ $FUNCNAME ] ---" - - # Without --dry-run this command will create a ~/.gnupg owned by root on - # systems where gpg has never been used, causing errors and confusion. - gpg --dry-run --list-keys ${OPENPGP_SIGNING_KEY_ID} >/dev/null 2>&1 || ( - _err "${ERR}Missing OpenPGP public key. Fetch it with this command:" - echo " wget 'https://sv.gnu.org/people/viewgpg.php?user_id=15145' -qO - | sudo -i gpg --import -" - exit 1 - ) + local user_id + local gpg_key_id + local exit_flag + + for user_id in "${!GPG_SIGNING_KEYS[@]}"; do + gpg_key_id=${GPG_SIGNING_KEYS[$user_id]} + # Without --dry-run this command will create a ~/.gnupg owned by root on + # systems where gpg has never been used, causing errors and confusion. + if ! gpg --dry-run --list-keys "$gpg_key_id" >/dev/null 2>&1; then + _err "${ERR}Missing OpenPGP public key ($gpg_key_id). Fetch it with this command:" + echo " wget \"https://sv.gnu.org/people/viewgpg.php?user_id=$user_id\" -qO - | sudo -i gpg --import -" + exit_flag=yes + fi + done + test "$exit_flag" = yes && exit 1 || true } chk_term() @@ -554,10 +566,19 @@ main() umask 0022 tmp_path="$(mktemp -t -d guix.XXX)" - guix_get_bin_list "${GNU_URL}" - guix_get_bin "${GNU_URL}" "${BIN_VER}" "$tmp_path" + if [ -z "${GUIX_BINARY_FILE_NAME}" ]; then + guix_get_bin_list "${GNU_URL}" + guix_get_bin "${GNU_URL}" "${BIN_VER}" "$tmp_path" + GUIX_BINARY_FILE_NAME=${BIN_VER}.tar.xz + else + if ! [[ $GUIX_BINARY_FILE_NAME =~ $ARCH_OS ]]; then + _err "$ARCH_OS not in ${GUIX_BINARY_FILE_NAME}; aborting" + fi + _msg "Using manually provided binary ${GUIX_BINARY_FILE_NAME}" + GUIX_BINARY_FILE_NAME=$(realpath "$GUIX_BINARY_FILE_NAME") + fi - sys_create_store "${BIN_VER}.tar.xz" "${tmp_path}" + sys_create_store "${GUIX_BINARY_FILE_NAME}" "${tmp_path}" sys_create_build_user sys_enable_guix_daemon sys_authorize_build_farms |