summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rwxr-xr-xetc/guix-install.sh66
-rw-r--r--etc/news.scm42
-rw-r--r--etc/snippets/tempel/text-mode253
-rw-r--r--etc/teams.scm.in3
4 files changed, 230 insertions, 134 deletions
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index 300681e111..3604c71ed6 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -9,7 +9,7 @@
# Copyright © 2020 Daniel Brooks <db48x@db48x.net>
# Copyright © 2021 Jakub Kądziołka <kuba@kadziolka.net>
# Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
-# Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+# Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
#
# This file is part of GNU Guix.
#
@@ -92,17 +92,20 @@ _debug()
fi
}
-# Return true if user answered yes, false otherwise.
+die()
+{
+ _err "${ERR}$*"
+ exit 1
+}
+
+# Return true if user answered yes, false otherwise. The prompt is
+# yes-biased, that is, when the user simply enter newline, it is equivalent to
+# answering "yes".
# $1: The prompt question.
prompt_yes_no() {
- while true; do
- read -rp "$1 " yn
- case $yn in
- [Yy]*) return 0;;
- [Nn]*) return 1;;
- *) _msg "Please answer yes or no."
- esac
- done
+ local -l yn
+ read -rp "$1 [Y/n]" yn
+ [[ ! $yn || $yn = y || $yn = yes ]] || return 1
}
chk_require()
@@ -137,7 +140,7 @@ chk_gpg_keyring()
if ! gpg --dry-run --list-keys "$gpg_key_id" >/dev/null 2>&1; then
if prompt_yes_no "${INF}The following OpenPGP public key is \
required to verify the Guix binary signature: $gpg_key_id.
-Would you like me to fetch it for you? (yes/no)"; then
+Would you like me to fetch it for you?"; then
wget "https://sv.gnu.org/people/viewgpg.php?user_id=$user_id" \
--no-verbose -O- | gpg --import -
else
@@ -220,8 +223,7 @@ chk_sys_arch()
local arch=powerpc64le
;;
*)
- _err "${ERR}Unsupported CPU type: ${arch}"
- exit 1
+ die "Unsupported CPU type: ${arch}"
esac
case "$os" in
@@ -229,8 +231,7 @@ chk_sys_arch()
local os=linux
;;
*)
- _err "${ERR}Your operation system (${os}) is not supported."
- exit 1
+ die "Your operation system (${os}) is not supported."
esac
ARCH_OS="${arch}-${os}"
@@ -254,7 +255,7 @@ chk_sys_nscd()
configure_substitute_discovery() {
if grep -q -- '--discover=no' "$1" && \
prompt_yes_no "Would you like the Guix daemon to automatically \
-discover substitute servers on the local network? (yes/no)"; then
+discover substitute servers on the local network?"; then
sed -i 's/--discover=no/--discover=yes/' "$1"
fi
}
@@ -285,8 +286,7 @@ guix_get_bin_list()
if [[ "${#bin_ver_ls}" -ne "0" ]]; then
_msg "${PAS}Release for your system: ${default_ver}"
else
- _err "${ERR}Could not obtain list of Guix releases."
- exit 1
+ die "Could not obtain list of Guix releases."
fi
# Use default to download according to the list and local ARCH_OS.
@@ -311,8 +311,7 @@ guix_get_bin()
"${url}/${bin_ver}.tar.xz" "${url}/${bin_ver}.tar.xz.sig"; then
_msg "${PAS}download completed."
else
- _err "${ERR}could not download ${url}/${bin_ver}.tar.xz."
- exit 1
+ die "could not download ${url}/${bin_ver}.tar.xz."
fi
pushd "${dl_path}" >/dev/null
@@ -320,8 +319,7 @@ guix_get_bin()
_msg "${PAS}Signature is valid."
popd >/dev/null
else
- _err "${ERR}could not verify the signature."
- exit 1
+ die "could not verify the signature."
fi
}
@@ -333,8 +331,7 @@ sys_create_store()
_debug "--- [ ${FUNCNAME[0]} ] ---"
if [[ -e "/var/guix" || -e "/gnu" ]]; then
- _err "${ERR}A previous Guix installation was found. Refusing to overwrite."
- exit 1
+ die "A previous Guix installation was found. Refusing to overwrite."
fi
cd "$tmp_path"
@@ -490,7 +487,7 @@ sys_enable_guix_daemon()
sys_authorize_build_farms()
{ # authorize the public key of the build farm
if prompt_yes_no "Permit downloading pre-built package binaries from the \
-project's build farm? (yes/no)"; then
+project's build farm?"; then
guix archive --authorize \
< ~root/.config/guix/current/share/guix/ci.guix.gnu.org.pub \
&& _msg "${PAS}Authorized public key for ci.guix.gnu.org"
@@ -557,6 +554,24 @@ sys_create_shell_completion()
_msg "${PAS}installed shell completion"
}
+sys_customize_bashrc()
+{
+ prompt_yes_no "Customize users Bash shell prompt for Guix?" || return
+ for bashrc in /home/*/.bashrc /root/.bashrc; do
+ test -f "$bashrc" || continue
+ grep -Fq '$GUIX_ENVIRONMENT' "$bashrc" && continue
+ cp "${bashrc}" "${bashrc}.bak"
+ echo '
+# Automatically added by the Guix install script.
+if [ -n "$GUIX_ENVIRONMENT" ]; then
+ if [[ $PS1 =~ (.*)"\\$" ]]; then
+ PS1="${BASH_REMATCH[1]} [env]\\\$ "
+ fi
+fi
+' >> "$bashrc"
+ done
+ _msg "${PAS}Bash shell prompt successfully customized for Guix"
+}
welcome()
{
@@ -626,6 +641,7 @@ main()
sys_authorize_build_farms
sys_create_init_profile
sys_create_shell_completion
+ sys_customize_bashrc
_msg "${INF}cleaning up ${tmp_path}"
rm -r "${tmp_path}"
diff --git a/etc/news.scm b/etc/news.scm
index 0a772a812b..9546568dab 100644
--- a/etc/news.scm
+++ b/etc/news.scm
@@ -25,6 +25,48 @@
(channel-news
(version 0)
+
+ (entry (commit "28ade1bab207974cce6a014e7187968511fc5526")
+ (title
+ (en "@option{--with-source} is now recursive")
+ (de "@option{--with-source} ist jetzt rekursiv")
+ (fr "@option{--with-source} est dorénavant récursive")
+ (pt "@option{--with-source} agora é recursiva"))
+ (body
+ (en "The @option{--with-source} package transformation option now
+uses the specified source for all matching packages, including dependencies.
+This option is useful for all package maintainers, developers, and, in
+general, all users who want Guix to facilitate their rights to modify their
+software and share their changes.
+
+Run @command{info \"(guix) Package Transformation Options\"} for more
+info.")
+ (de "Die Paketumwandlungsoption @option{--with-source} wird jetzt den
+angegebenen Quellcode für sämtliche passende Pakete benutzen, Abhängigkeiten
+eingeschlossen. Die Option hilft Paketbetreuern, Entwicklern und allgemein allen
+Nutzern, die Guix benutzen, das Recht, ihre Software anzupassen und
+Änderungen zu teilen, leichter auszuüben.
+
+Führen Sie für mehr Informationen @command{info \"(guix.de)
+Paketumwandlungsoptionen\"} aus.")
+ (fr "L'option de transformation de paquet @option{--with-source}
+s'applique désormais à tous les paquets correspondant, y compris les
+dépendances. Cette option est utile pour les personnes qui maintiennent un
+logiciel, en développent un ou, plus généralement, pour toute personne qui
+souhaite que Guix facilite l'exercice de ses droits à modifier le logiciel et
+à partager ses changements.
+
+Lancer @command{info \"(guix.fr) Options de transformation de paquets\"} pour
+plus d'informations.")
+ (pt "A opção de transformação de pacote @option{--with-source} agora
+usa a fonte especificada para todos os pacotes correspondentes, incluindo
+dependências. Essa opção é útil para todos os mantenedores de pacotes,
+desenvolvedores e usuários em geral que querem que o Guix facilite seu direito
+de modificar seu software e compartilhar suas mudanças.
+
+Execute @command{info \"(guix) Package Transformation Options\"} para mais
+informações.")))
+
(entry (commit "a13f5ead0265cf0fe11e60150547c09dfc8c45b0")
(title
(en "Guix System image creation is now documented")
diff --git a/etc/snippets/tempel/text-mode b/etc/snippets/tempel/text-mode
index 8096d92e47..364c21266d 100644
--- a/etc/snippets/tempel/text-mode
+++ b/etc/snippets/tempel/text-mode
@@ -2,117 +2,154 @@
text-mode :when (and (fboundp 'git-commit-mode) (git-commit-mode))
-(add\
- "gnu: Add "
- (p
- (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (goto-char (point-min))
- (when (re-search-forward "\\+(define-public \\(\\S-+\\)" nil 'noerror)
- (match-string-no-properties 1)))
- var ) "." n n
- "* " (car (magit-staged-files)) " (" (s var ) "): New variable.")
+(add\ "gnu: Add "
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (goto-char (point-min))
+ (when (re-search-forward "\\+(define-public \\(\\S-+\\)"
+ nil 'noerror)
+ (match-string-no-properties 1)))
+ var)
+ "." n n
+ "* " (car (magit-staged-files)) " (" (s var ) "): New variable.")
-(remove\
- "gnu: Remove "
- (p (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (goto-char (point-min))
- (when (re-search-forward "\\-(define-public \\(\\S-+\\)" nil 'noerror)
- (match-string-no-properties 1)))
- var) "." n n
- "* " (car (magit-staged-files)) " (" (s var) "): Delete variable.")
+(remove\ "gnu: Remove "
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (goto-char (point-min))
+ (when (re-search-forward "\\-(define-public \\(\\S-+\\)"
+ nil 'noerror)
+ (match-string-no-properties 1)))
+ var)
+ "." n n
+ "* " (car (magit-staged-files)) " (" (s var) "): Delete variable.")
-(rename\
- "gnu: "
- (p (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (beginning-of-buffer)
- (when (search-forward "-(define-public " nil 'noerror)
- (thing-at-point 'sexp 'no-properties)))
- prev-var)
- ": Rename package to "
- (p (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (beginning-of-buffer)
- (when (search-forward "+(define-public " nil 'noerror)
- (thing-at-point 'sexp 'no-properties)))
- new-var) "." n n
- "* " (car (magit-staged-files)) " (" (s prev-var) "): Define in terms of" n
- "'deprecated-package'." n
- "(" (s new-var) "): New variable, formerly known as \"" (s prev-var) "\".")
+(rename\ "gnu: "
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (beginning-of-buffer)
+ (when (search-forward "-(define-public " nil 'noerror)
+ (thing-at-point 'sexp 'no-properties)))
+ prev-var)
+ ": Rename package to "
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (beginning-of-buffer)
+ (when (search-forward "+(define-public " nil 'noerror)
+ (thing-at-point 'sexp 'no-properties)))
+ new-var)
+ "." n n
+ "* " (car (magit-staged-files)) " (" (s prev-var) "): "
+ "Define in terms of" n
+ "'deprecated-package'." n
+ "(" (s new-var) "): New variable, formerly known as \""
+ (s prev-var) "\".")
-(update\
- "gnu: "
- (p (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (goto-char (point-min))
- (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil 'noerror)
- (match-string-no-properties 1)))
- var)
- ": Update to "
- (p (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (goto-char (point-min))
- (search-forward "name" nil 'noerror)
- (search-forward "+" nil 'noerror) ; first change
- (when (and (search-forward "version " nil 'noerror)
- (looking-at-p "\""))
- (let ((end (save-excursion (search-forward "\")" nil 'noerror))))
- (when end
- (forward-char)
- (buffer-substring-no-properties (point) (- end 2))))))
- version) "." n n
- "* " (car (magit-staged-files)) " (" (s var) "): Update to " (s version) "."
- (mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-files))) n)
+(update\ "gnu: "
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (goto-char (point-min))
+ (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)"
+ nil 'noerror)
+ (match-string-no-properties 1)))
+ var)
+ ": Update to "
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (goto-char (point-min))
+ (search-forward "name" nil 'noerror)
+ (search-forward "+" nil 'noerror) ; first change
+ (when (and (search-forward "version " nil 'noerror)
+ (looking-at-p "\""))
+ (let ((end (save-excursion (search-forward "\")"
+ nil 'noerror))))
+ (when end
+ (forward-char)
+ (buffer-substring-no-properties (point) (- end 2))))))
+ version)
+ "." n n
+ "* " (car (magit-staged-files)) " (" (s var) "): "
+ "Update to " (s version) "." n
+ (mapconcat (lambda (file) (concat "* " file))
+ (cdr (magit-staged-files))
+ "\n"))
-(addcl\
- "gnu: Add cl-"
- (p (replace-regexp-in-string
- "^cl-" "" (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (beginning-of-buffer)
- (when (search-forward "+(define-public " nil 'noerror)
- (replace-regexp-in-string
- "^sbcl-" ""
- (thing-at-point 'sexp 'no-properties)))))
- var) "." n n
- "* " (car (magit-staged-files))
- " (cl-" (s var) ", ecl-" (s var) ", sbcl-" (s var) "): New variables.")
+(addcl\ "gnu: Add cl-"
+ (p (replace-regexp-in-string
+ "^cl-" "" (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (beginning-of-buffer)
+ (when (search-forward "+(define-public " nil 'noerror)
+ (replace-regexp-in-string
+ "^sbcl-" ""
+ (thing-at-point 'sexp 'no-properties)))))
+ var)
+ "." n n
+ "* " (car (magit-staged-files))
+ " (cl-" (s var)
+ ", ecl-" (s var)
+ ", sbcl-" (s var) "): New variables.")
-(https\
- "gnu: "
- (p (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (goto-char (point-min))
- (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil 'noerror)
- (match-string-no-properties 1)))
- var)
- ": Use HTTPS home page." n n
- "* " (car (magit-staged-files)) " (" (s var) ")[home-page]: Use HTTPS." n
- (mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-files))) n)
+(https\ "gnu: "
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (goto-char (point-min))
+ (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)"
+ nil 'noerror)
+ (match-string-no-properties 1)))
+ var)
+ ": Use HTTPS home page." n n
+ "* " (car (magit-staged-files)) " (" (s var) ")[home-page]: Use HTTPS."
+ n
+ (mapconcat (lambda (file) (concat "* " file))
+ (cdr (magit-staged-files))
+ "\n"))
-(move\
- "gnu: "
- (p (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (goto-char (point-min))
- (when (re-search-forward "\\-(define-public \\(\\S-+\\)" nil 'noerror)
- (match-string-no-properties 1)))
- var)
- ": Move to "
- (concat "("
- (string-replace "\.scm" ""
- (string-replace "/" " " (car (magit-staged-files))))
- ").") n
- n "* " (car (magit-staged-files)) " (" (s var) "): Move from here…"
- n "* " (cadr (magit-staged-files)) " (" (s var) "): …to here.")
+(move\ "gnu: "
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (goto-char (point-min))
+ (when (re-search-forward "\\-(define-public \\(\\S-+\\)"
+ nil 'noerror)
+ (match-string-no-properties 1)))
+ var)
+ ": Move to ("
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (goto-char (point-min))
+ (when (and
+ (re-search-forward "\\+(define-public \\(\\S-+\\)"
+ nil 'noerror)
+ (re-search-backward "modified[ ]*\\(\\S-+\\)"
+ nil 'noerror))
+ (string-replace
+ "\.scm" ""
+ (string-replace "/" " "
+ (match-string-no-properties 1)))))
+ new-module)
+ ")." n
+ n
+ "* " (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (goto-char (point-min))
+ (when (and
+ (re-search-forward "\\-(define-public \\(\\S-+\\)"
+ nil 'noerror)
+ (re-search-backward "modified[ ]*\\(\\S-+\\)"
+ nil 'noerror))
+ (match-string-no-properties 1)))
+ source)
+ " (" (s var) "): Move from here…" n
+ "* " (concat (string-replace " " "/" new-module) ".scm")
+ " (" (s var) "): …to here.")
diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index 2727505529..c27ea5271e 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -354,7 +354,8 @@ asdf-build-system."
(define-team translations
(team 'translations
#:name "Translations"
- #:scope (list (make-regexp "^po/"))))
+ #:scope (list "etc/news.scm"
+ (make-regexp "^po/"))))
(define-team installer
(team 'installer