Fixes <https://issues.guix.gnu.org/58858>.
* etc/guix-install.sh (main): Use 6 'X' characters in the template, as this is
the minimum required by Busybox's mktemp (which matches glibc's mktemp
behavior).
Reported-by: conses <contact@conses.eu>
This started out as a bug-fix for a GUI login loop that was resulting from XDG_DATA_DIRS
not including any of the host distro's directories. The solution was to export the vari-
able (with fail-safe defaults) before source-ing GUIX_PROFILE/etc/profile. It turns out
changes have already been made to ensure that XDG_DATA_DIRS, etc. are always exported
before anything guix-specific. So, this export is no longer necessary.
For reference, the aforementioned bug was found on a Debian 11 machine and it's guix.sh
init profile for guix version 1.2.
* etc/guix-install.sh (sys_create_init_profile): Remove unnecessary
XDG_DATA_DIRS export.
Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
* etc/guix-install.sh: Rename /etc/profile.d/guix.sh to zzz-guix.sh.
This script refers to environment variables set by the host distribution.
They may be set in other scripts in /etc/profile.d, which must therefore
be run first.
Example: in Ubuntu 20.04, XDG_DATA_DIRS is set in
/etc/profile.d/xdg_dirs_desktop_session.sh
Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
Avoid printing
Press return to continue...[1666352494.051]: Starting installation…
[1666352648.869]: …
when the return itself wasn't echoed on the console.
* etc/guix-install.sh (welcome): Add a carriage return to the prompt,
so that the next line of output may overwrite it.
This doesn't affect the installation (yet), but reserves the right to
default to safe values other than ‘y’ in future.
* etc/guix-install.sh (welcome): Warn if the ‘return’ wasn't.
Commit 6a2e303d3a had modified prompt_yes_no to only read a single character,
aiming to ease the user experience. This was, in retrospect, a bad idea, as
it makes user input error more likely and introduces complexity.
This commit reverts to line-oriented input, while preserving the default yes
value so that a user can simply hit 'Enter' at the prompt in place of typing
"yes".
* etc/guix-install.sh (_flush): Delete function.
(prompt_yes_no): Restore line-oriented read. Remove loop. Make anything else
than yes means no. Use Bash features to streamline definition.
Reported-by: Lars-Dominik Braun <lars@6xq.net> and others.
* etc/guix-install.sh (_flush): New function.
(prompt_yes_no): Clear input, then only read the first character, silently.
Add the [Yes/no] string to the message. When a newline is entered by the
user, treat it as the default value, which is "yes".
(chk_gpg_keyring): Remove "(yes/no)" from the prompt message.
(configure_substitute_discovery): Likewise.
(sys_authorize_build_farms): Likewise.
If "$HOME/.guix-home/profile" exists, use it for GUIX_PROFILE instead of
"$HOME/.guix-profile".
* etc/guix-install.sh (sys_create_init_profile): Check for 'guix home'
profile.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
The default values from the XDG base directory specification make little
sense for Guix System, and some scripts in Guix assume that they are not
"empty or unset": for example, see <https://issues.guix.gnu.org/56050>.
On foreign distros, however, omitting the default values is likely to
break software from the distro, perhaps even preventing the desktop
environment from starting. To smooth over the difference, use the
system-wide configuration to ensure the environment variables are always
explicitly set on foreign distros.
* etc/guix-install.sh (sys_create_init_profile): Explicitly initialize
XDG base directory variables.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Also ensure prompt_yes_no always print the message with a trailing space,
which is more pleasing to the eye.
* etc/guix-daemon.conf.in <--discover=no>: New guix-daemon option.
* etc/guix-daemon.service.in: Likewise.
* etc/init.d/guix-daemon.in: Likewise.
* etc/openrc/guix-daemon.in: Likewise.
* etc/guix-install.sh (configure_substitute_discovery): New procedure.
(sys_enable_guix_daemon): Ask the user whether automatic substitute discovery
should be enabled. Set the '--discover' argument accordingly.
(prompt_yes_no): Add a trailing space to the message.
(sys_authorize_build_farms): Remove trailing space from the message argument.
* NEWS (Distribution): Add news.
If GUIX_PROFILE is exported here, any subsequent
"source /some/other/profile/etc/profile" will set variables pointing to
"$HOME/.guix-profile" instead of pointing to the sourced profile.
* etc/guix-install.sh (sys_create_init_profile): No longer export GUIX_PROFILE.
* etc/guix-install.sh <FUNCNAME>: Explicitly refer to the first item of the
FUNCNAME array.
(ROOT_HOME): Replace variable by ~root directly; manually expanding it via
echo was not necessary.
(chk_gpg_keyring): Use an if branch for the exit to avoid a warning about
expression precedence.
(chk_term) <ansi_term>: Remove unused variable.
(guix_get_bin) <wget, gpg>: Test the commands directly. Use an array for the
wget arguments, which can then be properly expanded.
(sys_create_store): Disable SC1090 for the source command, as we don't care
about following the sourced script.
<_msg>: Reuse the GUIX_PROFILE variable in the message.
(sys_create_build_user) <getent>: Test the command directly.
The forthcoming 1.3.0 release will be signed with my personal GnuPG key; the
installation script need to tell users how fetch it.
* etc/guix-install.sh (OPENPGP_SIGNING_KEY_ID): Remove variable.
(GPG_SIGNING_KEYS): New associative array.
(chk_gpg_keyring): Process all the keys contained in the above array.
(main) <GUIX_BINARY_FILE_NAME>: Double quote variable.
This is necessary as the directory context is changed in the script, breaking
the use of a relative path.
* etc/guix-install.sh (main) <GUIX_BINARY_FILE_NAME>: Resolve its absolute
path via the 'realpath' command.
This is useful for example for testing release candidates not yet uploaded to
the FTP, or for testing manually downloaded images from the CI.
* etc/guix-install.sh (main)[GUIX_BINARY_FILE_NAME]: When this variable is
defined, use it as the file name of a Guix binary, instead of automatically
retrieving the latest archive from the FTP.
Fixes <https://bugs.gnu.org/42129>.
* etc/guix-install.sh (sys_create_build_user): If a 'kvm' group exists,
add it to the guixbuilders' lists of supplementary groups.
This makes powerpc64le-linux a supported architecture for Guix, but not for
Guix System.
* Makefile.am (SUPPORTED_SYSTEMS): Add an entry for powerpc64le-linux.
* etc/guix-install.sh (chk_sys_arch): Same.
* guix/packages.scm (%supported-systems): Same.
* m4/guix.m4 (GUIX_ASSERT_SUPPORTED_SYSTEM): Same.
* tests/guix-build.sh (all_systems): Same.
* etc/guix-install.sh (sys_create_init_profile): Set PATH and INFOPATH
even when $_GUIX_PROFILE does not exist.
After initial installation on a foreign distro, the guix pull profile
won't be present in path. This means that the first guix pull won't take
effect until the shell is restarted.
~/.guix-profile cannot be pre-loaded like this as the relevant paths are
stored in ~/.guix-profile/etc/profile, which simply won't exist.
However, guix package will output a relevant hint that instructs the
user to reload the profile, so this isn't a problem.
Almost the entire file is indented with spaces, a few tabs slipped in, clean
them up.
* etc/guix-install.sh(chk_sys_arch): Replace tabs with spaces.
(sys_enable_guix_daemon): Likewise.
Signed-off-by: Christopher Baines <mail@cbaines.net>
Fixes <https://bugs.gnu.org/43744>.
* etc/guix-install.sh (chk_sys_nscd): New function to check if the service
'nscd is running, otherwise suggest to install distribution-wide.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Fixes <https://bugs.gnu.org/43744>.
* etc/guix-install.sh (sys_create_shell_completion): New function to add
system wide all the symlinks for supported shell completions.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* etc/guix-install.sh (guix_get_bin_list): Call grep with an extended
regular expression instead of a non-POSIX Perl regular expression.
(sys_create_store): Remove ‘--warning=no-timestamp’ argument to tar.
Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
Without quotes, zsh fails with "no matches found" as it tries to
interpret the question mark.
* etc/guix-install.sh (chk_gpg_keyring): Enclose URL in single quotes.
This follows up on 1a1faa78b0, and avoids
the (non-fatal) error seen in <https://issues.guix.gnu.org/41356>.
/gnu/store will remain writable on new foreign distribution
installations until the next release.
* etc/guix-install.sh (sys_enable_guix_daemon): Check for
‘gnu-store.mount’ presence before trying to cp it.
Update forgotten copyright header.
* etc/gnu-store.mount.in: New file.
* nix/local.mk (nodist_systemdservice_DATA): Add it.
(etc/%.mount): New rule for it.
* etc/guix-install.sh (sys_enable_guix_daemon): Install it.
* doc/guix.texi (Binary Installation): Document it.
* .gitignore: Ignore changes to it.
Fixes <https://bugs.gnu.org/39984>.
Suggested by Adam Porter <adam@alphapapa.net>.
* etc/guix-install.sh (sys_create_init_profile): Add a trailing colon to
'INFOPATH'.
If $XDG_DATA_DIRS is unset, default value of "/usr/local/share:/usr/share"
is used according to XDG Base Directory Specification. However,
/etc/profile.d/guix.sh treats this value as empty list when appending its
own directory, so after installing Guix on the system, launchers such
as Rofi stop searching for .desktop files in /usr/share/applications/
and can't launch applications other than those installed with Guix.
This patch fixes the bug in generated /etc/profile.d/guix.sh
* etc/guix-install.sh (sys_create_init_profile): Use default value of
/usr/local/share:/usr/share/ before appending if $XDG_DATA_DIRS is not
set.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* etc/guix-install.sh (sys_create_init_profile): Add code to create
/etc/profile.d if it somehow does not exist; the function still carries
on because it is possible that /etc/profile is still configured to read
the *.sh files from /etc/profile.d, if they exist.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>