summary refs log tree commit diff
path: root/etc
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2021-10-12 16:50:47 +0000
committerMathieu Othacehe <othacehe@gnu.org>2021-10-12 17:46:23 +0000
commita1eca979fb8da842e73c42f4f53be29b169810f2 (patch)
tree681c7283e412bb8a29c2531c4408b49c3e184764 /etc
parent48d86a9ec6d8d2e97da2299ea41a03ef4cdaab83 (diff)
parent371aa5777a3805a3886f3feea5f1960fe3fe4219 (diff)
downloadguix-a1eca979fb8da842e73c42f4f53be29b169810f2.tar.gz
Merge remote-tracking branch 'origin/master' into core-updates-frozen.
Diffstat (limited to 'etc')
-rwxr-xr-xetc/committer.scm.in26
-rw-r--r--etc/completion/bash/guix58
-rw-r--r--etc/disarchive-manifest.scm2
-rw-r--r--etc/guix-gc.service.in20
-rw-r--r--etc/guix-gc.timer15
-rwxr-xr-xetc/guix-install.sh8
-rw-r--r--etc/news.scm132
7 files changed, 226 insertions, 35 deletions
diff --git a/etc/committer.scm.in b/etc/committer.scm.in
index e81ce16611..1ad83e37d7 100755
--- a/etc/committer.scm.in
+++ b/etc/committer.scm.in
@@ -5,6 +5,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
+;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -288,6 +289,15 @@ ChangeLog entry."
             (break-string-with-newlines message/f 72)
             (break-string-with-newlines changelog/f 72))))
 
+(define (add-copyright-line line)
+  "Add the copyright line on LINE to the previous commit."
+  (let ((author (match:substring
+                 (string-match "^\\+;;; Copyright ©[^[:alpha:]]+(.*)$" line)
+                 1)))
+    (format
+     (current-output-port) "Amend and add copyright line for ~a~%" author)
+    (system* "git" "commit" "--amend" "--no-edit")))
+
 (define (group-hunks-by-sexp hunks)
   "Return a list of pairs associating all hunks with the S-expression they are
 modifying."
@@ -370,15 +380,23 @@ modifying."
                                     (error "Cannot apply")))
                                 (usleep %delay))
                               hunks)
-                    (change-commit-message* (hunk-file-name (first hunks))
-                                            old new)
-                    (let ((port (open-pipe* OPEN_WRITE "git" "commit" "-F" "-")))
+                    (define copyright-line
+                      (any (lambda (line) (and=> (string-prefix? "+;;; Copyright ©" line)
+                                              (const line)))
+                                (hunk-diff-lines (first hunks))))
+                    (cond
+                     (copyright-line
+                      (add-copyright-line copyright-line))
+                     (else
+                      (let ((port (open-pipe* OPEN_WRITE "git" "commit" "-F" "-")))
+                        (change-commit-message* (hunk-file-name (first hunks))
+                                                old new)
                       (change-commit-message* (hunk-file-name (first hunks))
                                               old new
                                               port)
                       (usleep %delay)
                       (unless (eqv? 0 (status:exit-val (close-pipe port)))
-                        (error "Cannot commit")))))
+                        (error "Cannot commit")))))))
                  ;; XXX: we recompute the hunks here because previous
                  ;; insertions lead to offsets.
                  (new+old+hunks (diff-info)))))))
diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
index a9386e7794..87d9911e53 100644
--- a/etc/completion/bash/guix
+++ b/etc/completion/bash/guix
@@ -32,7 +32,7 @@ _guix_complete_command ()
                                      | grep '^    ' \
 				     | sed '-es/^ *\([a-z-]\+\).*$/\1/g')"
     fi
-    COMPREPLY=($(compgen -W "$_guix_commands" -- "$word_at_point"))
+    COMPREPLY+=($(compgen -W "$_guix_commands" -- "$word_at_point"))
 }
 
 _guix_complete_subcommand ()
@@ -41,7 +41,7 @@ _guix_complete_subcommand ()
     local subcommands="$(${COMP_WORDS[0]} $command --help 2> /dev/null \
                          | grep '^   [a-z]' \
                          | sed -e's/^ \+\([a-z-]\+\).*$/\1/g')"
-    COMPREPLY=($(compgen -W "$subcommands" -- "${COMP_WORDS[$COMP_CWORD]}"))
+    COMPREPLY+=($(compgen -W "$subcommands" -- "${COMP_WORDS[$COMP_CWORD]}"))
 }
 
 _guix_complete_available_package ()
@@ -54,7 +54,7 @@ _guix_complete_available_package ()
 	_guix_available_packages="$(${COMP_WORDS[0]} package -A 2> /dev/null \
                                     | cut -f1)"
     fi
-    COMPREPLY=($(compgen -W "$_guix_available_packages" -- "$prefix"))
+    COMPREPLY+=($(compgen -W "$_guix_available_packages" -- "$prefix"))
 }
 
 _guix_complete_installed_package ()
@@ -64,7 +64,7 @@ _guix_complete_installed_package ()
     local prefix="$1"
     local packages="$(${COMP_WORDS[0]} package -I "^$prefix" 2> /dev/null \
                       | cut -f1)"
-    COMPREPLY=($(compgen -W "$packages" -- "$prefix"))
+    COMPREPLY+=($(compgen -W "$packages" -- "$prefix"))
 }
 
 _guix_complete_option ()
@@ -79,7 +79,7 @@ _guix_complete_option ()
                             | grep '^  \+-' \
                             | sed -e's/^.*--\([a-zA-Z0-9_-]\+\)\(=\?\).*/--\1\2/g')"
     compopt -o nospace
-    COMPREPLY=($(compgen -W "$options" -- "$2"))
+    COMPREPLY+=($(compgen -W "$options" -- "$2"))
 }
 
 _guix_is_option ()
@@ -171,10 +171,22 @@ _guix_complete_file ()
     COMPREPLY=()
 }
 
+_guix_complete_available_package_or_store_file ()
+{
+    _guix_complete_available_package "$@"
+
+    # The current _guix_complete_file implementation doesn't compose (append to
+    # COMPREPLY), so we suggest file names only if no package names matched.
+    if [[ -z "$COMPREPLY" ]]
+    then
+	_guix_complete_file # TODO: restrict to store files
+    fi
+}
+
 _guix_complete_pid ()
 {
     local pids="$(cd /proc; echo [0-9]*)"
-    COMPREPLY=($(compgen -W "$pids" -- "$1"))
+    COMPREPLY+=($(compgen -W "$pids" -- "$1"))
 }
 
 _guix_complete ()
@@ -237,15 +249,7 @@ _guix_complete ()
 		else
 		    _guix_complete_available_package "$word_at_point"
 		fi
-	    elif [[ "$command" = "remove" ]]
-	    then
-                if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p
-                then
-                    _guix_complete_file
-		else
-		    _guix_complete_installed_package "$word_at_point"
-		fi
-	    elif [[ "$command" = "upgrade" ]]
+	    elif [[ "$command" = "upgrade" || "$command" = "remove" ]]
 	    then
                 if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p
                 then
@@ -259,7 +263,7 @@ _guix_complete ()
                 then
                     _guix_complete_file
 		else
-		    _guix_complete_available_package "$word_at_point"
+		    _guix_complete_available_package_or_store_file "$word_at_point"
                 fi
 	    elif [[ "$command" = "environment" ]]
 	    then
@@ -272,13 +276,16 @@ _guix_complete ()
 		else
 		    _guix_complete_available_package "$word_at_point"
 		fi
-	    elif [[ "$command" = "download" ]]
+	    elif [[ "$command" = "download" || "$command" = "gc" || "$command" = "hash" ]]
+	    then
+		_guix_complete_file
+	    elif [[ "$command" = "size" ]]
 	    then
-		 _guix_complete_file
+		_guix_complete_available_package_or_store_file "$word_at_point"
 	    elif [[ "$command" = "system" ]]
 	    then
-		case $COMP_CWORD in
-		    2) _guix_complete_subcommand;;
+		case $((COMP_CWORD - command_index)) in
+		    1) _guix_complete_subcommand;;
 		    *) _guix_complete_file;; # TODO: restrict to *.scm
 		esac
             elif [[ "$command" = "pull" ]]
@@ -297,22 +304,21 @@ _guix_complete ()
                 fi
 	    elif [[ "$command" = "container" ]]
 	    then
-		case $COMP_CWORD in
-		    2) _guix_complete_subcommand;;
-		    3) _guix_complete_pid "$word_at_point";;
+		case $((COMP_CWORD - command_index)) in
+		    1) _guix_complete_subcommand;;
+		    2) _guix_complete_pid "$word_at_point";;
 		    *) _guix_complete_file;;
 		esac
 	    elif [[ "$command" = "import" ]]
 	    then
 		_guix_complete_subcommand
-	    elif [[ "$command" = "hash" || "$command" = "gc" ]]
-	    then
-		_guix_complete_file
             elif [[ "$command" = "weather" ]]
             then
                 if _guix_is_dash_m
                 then
                     _guix_complete_file
+		else
+		    _guix_complete_available_package "$word_at_point"
                 fi
 	    else
 		_guix_complete_available_package "$word_at_point"
diff --git a/etc/disarchive-manifest.scm b/etc/disarchive-manifest.scm
index 5cc59f5e2a..60edee8eac 100644
--- a/etc/disarchive-manifest.scm
+++ b/etc/disarchive-manifest.scm
@@ -108,5 +108,5 @@ an empty directory if ORIGIN could not be disassembled."
   (manifest
    (list (manifest-entry
            (name "disarchive-collection")
-           (version (length origins))
+           (version (number->string (length origins)))
            (item (disarchive-collection origins))))))
diff --git a/etc/guix-gc.service.in b/etc/guix-gc.service.in
new file mode 100644
index 0000000000..2f1ca6584b
--- /dev/null
+++ b/etc/guix-gc.service.in
@@ -0,0 +1,20 @@
+# This is a "service unit file" for the systemd init system to perform a
+# one-shot 'guix gc' operation.  It is meant to be triggered by a timer.
+# Drop it in /etc/systemd/system or similar together with 'guix-gc.timer'
+# to set it up.
+
+[Unit]
+Description=Discard unused Guix store items
+
+[Service]
+Type=oneshot
+# Customize the 'guix gc' arguments to fit your needs.
+ExecStart=@localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix gc -d 1m -F 10G
+PrivateDevices=yes
+PrivateNetwork=yes
+PrivateUsers=no
+ProtectKernelTunables=yes
+ProtectKernelModules=yes
+ProtectControlGroups=yes
+MemoryDenyWriteExecute=yes
+SystemCallFilter=@default @file-system @basic-io @system-service
diff --git a/etc/guix-gc.timer b/etc/guix-gc.timer
new file mode 100644
index 0000000000..192132fbda
--- /dev/null
+++ b/etc/guix-gc.timer
@@ -0,0 +1,15 @@
+# This is a "timer unit file" for the systemd init system to trigger
+# 'guix-gc.service' periodically.  Drop it in /etc/systemd/system or similar
+# together with 'guix-gc.service' to set it up.
+
+[Unit]
+Description=Discard unused Guix store items
+
+[Timer]
+OnCalendar=weekly
+AccuracySec=1h
+Persistent=true
+RandomizedDelaySec=6000
+
+[Install]
+WantedBy=timers.target
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index 4f0f89100d..b0d4a8b95e 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -139,12 +139,12 @@ chk_gpg_keyring()
 required to verify the Guix binary signature: $gpg_key_id.
 Would you like me to fetch it for you? (yes/no)"; then
                 wget "https://sv.gnu.org/people/viewgpg.php?user_id=$user_id" \
-                     -qO - | gpg --import -
+                     --no-verbose -O- | gpg --import -
             else
                 _err "${ERR}Missing OpenPGP public key ($gpg_key_id).
 Fetch it with this command:
 
-  wget \"https://sv.gnu.org/people/viewgpg.php?user_id=$user_id\" -qO - | \
+  wget \"https://sv.gnu.org/people/viewgpg.php?user_id=$user_id\" -O - | \
 sudo -i gpg --import -"
                 exit_flag=yes
             fi
@@ -272,7 +272,7 @@ guix_get_bin_list()
     _debug "--- [ ${FUNCNAME[0]} ] ---"
 
     # Filter only version and architecture
-    bin_ver_ls=("$(wget -qO- "$gnu_url" \
+    bin_ver_ls=("$(wget "$gnu_url" --no-verbose -O- \
         | sed -n -e 's/.*guix-binary-\([0-9.]*[a-z0-9]*\)\..*.tar.xz.*/\1/p' \
         | sort -Vu)")
 
@@ -305,7 +305,7 @@ guix_get_bin()
     _msg "${INF}Downloading Guix release archive"
 
     wget --help | grep -q '\--show-progress' \
-        && wget_args=("-q" "--show-progress")
+        && wget_args=("--no-verbose" "--show-progress")
 
     if wget "${wget_args[@]}" -P "$dl_path" \
             "${url}/${bin_ver}.tar.xz" "${url}/${bin_ver}.tar.xz.sig"; then
diff --git a/etc/news.scm b/etc/news.scm
index b4a08067c5..d3a56865b6 100644
--- a/etc/news.scm
+++ b/etc/news.scm
@@ -15,6 +15,7 @@
 ;; Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
 ;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
+;; Copyright © 2021 Andrew Tropin <andrew@trop.in>
 ;;
 ;; Copying and distribution of this file, with or without modification, are
 ;; permitted in any medium without royalty provided the copyright notice and
@@ -22,6 +23,137 @@
 
 (channel-news
  (version 0)
+(entry (commit "a2324d8b56eabf8117bca220a507cc791edffd2e")
+        (title
+         (en "Guix Home is a part of GNU Guix")
+         (de "Guix Home ist jetzt Teil von GNU Guix")
+         (ru "Guix Home теперь поставляется в составе GNU Guix"))
+        (body
+         (en "Guix Home splitted out from rde project and now is a part of
+Guix proper.  It is available as a @emph{technology preview} and thus subject
+to change.
+
+The new @command{guix home} command with its actions allows users to
+manage their packages and configurations (aka. dotfiles) in a declarative way,
+similar to how many people manage their system with @command{guix system}.
+
+Take a look at available actions and arguments:
+@example
+guix home --help
+@end example
+
+See @command{info \"(guix) Home Configuration\"} for more information.")
+         (de "Guix Home ist aus dem rde-Projekt ins offizielle Guix übernommen
+worden. Es ist als @emph{Technologievorschau} bereits verfügbar, aber die
+Schnittstelle kann sich in Zukunft noch ändern.
+
+Der neue Befehl @command{guix home} ermöglicht es, die Pakete und
+Konfigurationsdateien (Dotfiles) für ein Benutzerkonto im deklarativen Stil zu
+verwalten. Es ist analog dazu, wie man @command{guix system} benutzen kann, um
+sein System zu verwalten.
+
+Werfen Sie einen Blick auf die verfügbaren Aktionen und Argumente:
+@example
+guix home --help
+@end example
+
+Führen Sie für mehr Informationen @command{info \"(guix) Home Configuration\"}
+aus.")
+         (ru "Guix Home отделился от проекта rde и теперь является частью
+Guix.  Новая команда @command{guix home} даёт возможность пользователям
+управлять их пакетами и конфигурациями (дотфайлами) для них в декларативном
+стиле, аналогично тому, как многие люди управляют своими системами с помощью
+@command{guix system}.
+
+Чтобы получить список доступных действий и аргументов:
+@example
+guix home --help
+@end example
+
+Смотрите @command{info \"(guix) Home Configuration\"} для получения более
+детальных сведений.")))
+
+ (entry (commit "5b32ad4f6f555d305659cee825879df075b06331")
+        (title
+         (en "New @option{--max-depth} option for @command{guix graph}")
+         (de "Neue Option @option{--max-depth} für @command{guix graph}")
+         (fr "Nouvelle option @option{--max-depth} pour @command{guix graph}"))
+        (body
+         (en "The @command{guix graph} command has a new @option{--max-depth}
+(or @option{-M}) option, which allows you to restrict a graph to the given
+depth---very useful when visualizing large graphs.  For example, the command
+below displays, using the @code{xdot} package, the dependency graph of
+LibreOffice, including only nodes that are at most at distance 2 of
+LibreOffice itself:
+
+@example
+guix graph -M 2 libreoffice | xdot -
+@end example
+
+See @command{info \"(guix) Invoking guix graph\"} for more information.")
+         (de "Der Befehl @command{guix graph} verfügt über eine neue
+Befehlszeilenoption @option{--max-depth} (oder @option{-M}), mit der
+Sie einen Graphen auf die angegebene Tiefe einschränken. Das ist vor
+allem bei großen Graphen nützlich; zum Beispiel zeigt der folgende
+Befehl, unter Verwendung des Pakets @code{xdot}, den
+Abhängigkeitsgraphen von LibreOffice unter Ausschluss der Knoten, die
+eine Distanz größer als 2 von LibreOffice selbst haben:
+
+@example
+guix graph -M 2 libreoffice | xdot -
+@end example
+
+Führen Sie @code{info \"(guix.de) Aufruf von guix graph\"} aus, um mehr zu
+erfahren.")
+         (fr "La commande @command{guix graph} dispose d'une nouvelle option
+@option{--max-depth} (ou @option{-M}) pour restreindre la profondeur d'un
+graphe---très utile pour visualiser des gros graphes.  Par exemple, la
+commande ci-dessous affiche, en utilisant @code{xdot}, le graphe de dépendance
+de LibreOffice en n'incluant que les nœuds qui sont au plus à distance 2 de
+LibreOffice soi-même :
+
+@example
+guix graph -M 2 libreoffice | xdot -
+@end example
+
+Voir @command{info \"(guix.fr) Invoquer guix graph\"} pour plus
+d'informations.")))
+
+ (entry (commit "05f44c2d858a1e7b13c90362c35fa86bdc4d5a24")
+        (title
+         (en "Channel clones fall back to Software Heritage")
+         (de "Zum Klonen von Kanälen wird notfalls auf Software Heritage zurückgegriffen")
+         (fr "Les clones de canaux peuvent recourir à Software Heritage"))
+        (body
+         (en "When @command{guix time-machine} or @command{guix pull} fetches
+a channel pinned to a specific commit, it now automatically falls back to
+cloning it from the Software Heritage archive if the original URL is
+unreachable.  This contributes to long-term reproducibility.  See
+@command{info \"(guix) Replicating Guix\"}.
+
+Automatic fallback also works for other Git clones made on your behalf, such
+as when using @option{--with-commit} and related package transformation
+options.")
+         (de "Wenn bei @command{guix time-machine} oder @command{guix
+pull} ein bestimmter Commit eines Kanals bezogen werden soll, wird
+jetzt für den Fall, dass die ursprüngliche URL unerreichbar ist,
+automatisch vom Software-Heritage-Archiv geklont. Das trägt zur
+langfristigen Reproduzierbarkeit bei. Siehe @command{info \"(guix.de)
+Guix nachbilden\"}.
+
+Der automatische Rückgriff auf Software Heritage findet auch
+Verwendung bei anderen Arten von Git-Klon, die Guix durchführt, z.B.@:
+wenn Sie @option{--with-commit} und ähnliche Paketumwandlungsoptionen
+einsetzen.")
+         (fr "Quand la commande @command{guix time-machine} ou @command{guix
+pull} récupère un canal fixé à une révision spécifique, elle est maintenant
+capable de le cloner depuis l'archive Software Heritage si l'URL initiale
+n'est plus disponible.  Cela contribue à la reproductibilité à long terme.
+Voir @command{info \"(guix.fr) Répliquer Guix\"}.
+
+Ce recours à Software Heritage fonctionne aussi pour les autres clones Git que
+Guix peut faire, comme lorsqu'on utilise @option{--with-commit} et les options
+de transformation de paquet similaires.")))
 
  (entry (commit "f23803af2018a148fb088f2516d79c20d6bf95f0")
         (title