From 4329aad0a3853c22556b3193b7299a8a0e0e7c74 Mon Sep 17 00:00:00 2001 From: Carlos Ramirez Date: Tue, 5 Oct 2021 23:33:05 +0200 Subject: [PATCH 01/13] Replace which by command -v --- pengwin-setup | 2 +- pengwin-setup.d/docker.sh | 47 +++++++++++++++++++++++++++++---- pengwin-setup.d/explorer.sh | 21 ++++++++++++++- pengwin-setup.d/guilib.sh | 4 +-- pengwin-setup.d/lamp.sh | 19 ++++++++++++- pengwin-setup.d/nodejs.sh | 12 ++++----- pengwin-setup.d/services.sh | 31 ++++++++++++++++++++-- rpm/pengwin-setup.d/guilib.sh | 2 +- rpm/pengwin-setup.d/services.sh | 20 +++++++++++++- 9 files changed, 138 insertions(+), 20 deletions(-) diff --git a/pengwin-setup b/pengwin-setup index d628949e..e417c560 100755 --- a/pengwin-setup +++ b/pengwin-setup @@ -1,6 +1,6 @@ #!/bin/bash -SetupDir="/usr/local/pengwin-setup.d" +SetupDir="/mnt/f/WhitewaterFoundry/pengwin-setup/pengwin-setup.d" export VERSION="1.2a" diff --git a/pengwin-setup.d/docker.sh b/pengwin-setup.d/docker.sh index e96cb202..40fd40f2 100644 --- a/pengwin-setup.d/docker.sh +++ b/pengwin-setup.d/docker.sh @@ -14,6 +14,18 @@ declare WIN_CUR_VER #Imported global variables declare USER +####################################### +# description +# Globals: +# GOPATH +# GOROOT +# GOVERSION +# PATH +# USER +# wHome +# Arguments: +# None +####################################### function docker_install_build_relay() { #Build the relay if [[ ! -f "${wHome}/.npiperelay/npiperelay.exe" ]]; then @@ -75,7 +87,7 @@ function docker_install_build_relay() { PATH="$1" # Check if we have Windows Path -if ( which cmd.exe >/dev/null ); then +if ( command -v cmd.exe >/dev/null ); then connected=$(docker version 2>&1 | grep -c "daemon\|error") if [[ ${connected} != 0 ]]; then @@ -98,7 +110,7 @@ EOF cat <<'EOF' >>docker_relay.sh # Check if we have Windows Path -if ( which cmd.exe >/dev/null ); then +if ( command -v cmd.exe >/dev/null ); then sudo docker-relay "${PATH}" fi EOF @@ -117,6 +129,14 @@ EOF sudo docker version } +####################################### +# description +# Globals: +# DOCKER_HOST +# connected +# Arguments: +# None +####################################### function docker_install_conf_tcp() { echo "Connect to Docker via TCP" @@ -141,15 +161,20 @@ EOF fi } +####################################### +# description +# Arguments: +# None +####################################### function docker_install_conf_toolbox() { echo "Connect to Docker Toolbox" cat <<'EOF' >>docker_relay.sh # Check if we have Windows Path -if ( which cmd.exe >/dev/null ); then +if ( command -v cmd.exe >/dev/null ); then VM=${DOCKER_MACHINE_NAME-default} - DOCKER_MACHINE="$(which docker-machine.exe)" + DOCKER_MACHINE="$(command -v docker-machine.exe)" eval "$("${DOCKER_MACHINE}" env --shell=bash --no-proxy "${VM}" 2>/dev/null )" > /dev/null 2>&1 if [[ "${DOCKER_CERT_PATH}" != "" ]] ; then @@ -165,6 +190,18 @@ EOF docker version } +####################################### +# description +# Globals: +# DOCKER_COMPOSE_VERSION +# DOCKER_VERSION +# HOME +# WIN_CUR_VER +# Arguments: +# None +# Returns: +# ... +####################################### function main() { if (confirm --title "DOCKER" --yesno "Would you like to install the bridge to Docker?" 8 55); then @@ -268,7 +305,7 @@ EOF cat <<'EOF' >>create-mnt-c-link.sh # Check if we have Windows Path -if ( which cmd.exe >/dev/null ); then +if ( command -v cmd.exe >/dev/null ); then sudo create-mnt-c-link fi diff --git a/pengwin-setup.d/explorer.sh b/pengwin-setup.d/explorer.sh index 8574fd64..55a4513b 100644 --- a/pengwin-setup.d/explorer.sh +++ b/pengwin-setup.d/explorer.sh @@ -7,6 +7,13 @@ source "$(dirname "$0")/common.sh" "$@" declare SetupDir +####################################### +# description +# Globals: +# wHome +# Arguments: +# None +####################################### function install_explorer() { local exec_name='pengwin.exe' @@ -37,7 +44,7 @@ EOF cp /usr/local/lib/pengwin.ico "${wHome}/Pengwin" - local fullexec=$(wslpath -m "$(which ${exec_name})" | sed 's$/$\\\\\\\\$g') + local fullexec=$(wslpath -m "$(command -v ${exec_name})" | sed 's$/$\\\\\\\\$g') local icopath=$(cmd-exe /C "echo '%USERPROFILE%\\Pengwin\\pengwin.ico'" | tr -d '\r' | sed 's$\\$\\\\\\\\$g') icopath=$(echo $icopath | tr -d "\'") sed -i "s/_${plain_name}Path_/${fullexec}/g" Install.reg @@ -62,6 +69,13 @@ EOF fi } +####################################### +# description +# Globals: +# SKIP_CONFIMATIONS +# Arguments: +# None +####################################### function upgrade_explorer() { local plain_name='WLinux' @@ -83,6 +97,11 @@ EOF install_explorer } +####################################### +# description +# Arguments: +# 1 +####################################### function main() { if [[ $# -gt 0 && "$1" == "--upgrade" ]]; then diff --git a/pengwin-setup.d/guilib.sh b/pengwin-setup.d/guilib.sh index f9ead4bf..21c91d9e 100644 --- a/pengwin-setup.d/guilib.sh +++ b/pengwin-setup.d/guilib.sh @@ -34,7 +34,7 @@ if (confirm --title "GUI Libraries" --yesno "Would you like to install a base se #!/bin/sh # Check if we have Windows Path -if ( which cmd.exe >/dev/null ); then +if ( command -v cmd.exe >/dev/null ); then eval "\$(timeout 2s dbus-launch --auto-syntax)" fi @@ -47,7 +47,7 @@ EOF #!/bin/fish # Check if we have Windows Path -if which cmd.exe >/dev/null +if command -v cmd.exe >/dev/null for line in (timeout 2s dbus-launch | string match '*=*') set -l kv (string split -m 1 = -- \$line ) diff --git a/pengwin-setup.d/lamp.sh b/pengwin-setup.d/lamp.sh index 10670159..c2e82a88 100644 --- a/pengwin-setup.d/lamp.sh +++ b/pengwin-setup.d/lamp.sh @@ -3,6 +3,18 @@ # shellcheck source=./common.sh source "$(dirname "$0")/common.sh" "$@" +####################################### +# description +# Globals: +# DEBIAN_FRONTEND +# HOME +# NON_INTERACTIVE +# profile_start_lamp +# Arguments: +# None +# Returns: +# 1 ... +####################################### function install_lamp() { if (confirm --title "LAMP Stack" --yesno "Would you like to install the LAMP Stack?" 10 60); then @@ -116,7 +128,7 @@ EOF #!/bin/bash # Check if we have Windows Path -if ( which cmd.exe >/dev/null ); then +if ( command -v cmd.exe >/dev/null ); then sudo ${start_lamp} @@ -134,6 +146,11 @@ EOF } +####################################### +# description +# Arguments: +# None +####################################### function main() { install_lamp diff --git a/pengwin-setup.d/nodejs.sh b/pengwin-setup.d/nodejs.sh index d93fad32..43da5c23 100644 --- a/pengwin-setup.d/nodejs.sh +++ b/pengwin-setup.d/nodejs.sh @@ -38,9 +38,9 @@ echo "Look for Windows version of npm" NPM_WIN_PROFILE="/etc/profile.d/rm-win-npm-path.sh" NPM_PROFILE="/etc/profile.d/n-prefix.sh" -if [[ "$(which npm)" == $(wslpath 'C:\')* ]]; then +if [[ "$(command -v npm)" == $(wslpath 'C:\')* ]]; then - if ! (confirm --title "npm in Windows" --yesno "npm is already installed in Windows in \"$(wslpath -m "$(which npm)")\".\n\nWould you still want to install the Linux version? This will hide the Windows version inside Pengwin." 12 80); then + if ! (confirm --title "npm in Windows" --yesno "npm is already installed in Windows in \"$(wslpath -m "$(command -v npm)")\".\n\nWould you still want to install the Linux version? This will hide the Windows version inside Pengwin." 12 80); then echo "Skipping NODE" exit 1 fi @@ -48,18 +48,18 @@ if [[ "$(which npm)" == $(wslpath 'C:\')* ]]; then sudo tee "${NPM_WIN_PROFILE}" </dev/null ); then +if ( command -v cmd.exe >/dev/null ); then WIN_C_PATH="\$(wslpath 'C:\')" while [[ true ]]; do - WIN_YARN_PATH="\$(dirname "\$(which yarn)")" + WIN_YARN_PATH="\$(dirname "\$(command -v yarn)")" if [[ "\${WIN_YARN_PATH}" == "\${WIN_C_PATH}"* ]]; then export PATH=\$(echo "\${PATH}" | sed -e "s#\${WIN_YARN_PATH}##") fi - WIN_NPM_PATH="\$(dirname "\$(which npm)")" + WIN_NPM_PATH="\$(dirname "\$(command -v npm)")" if [[ "\${WIN_NPM_PATH}" == "\${WIN_C_PATH}"* ]]; then export PATH=\$(echo "\${PATH}" | sed -e "s#\${WIN_NPM_PATH}##") else @@ -79,7 +79,7 @@ if [[ ${menu_choice} == *"NVERMAN"* ]]; then echo "Installing n, Node.js version manager" curl -L https://git.io/n-install -o n-install.sh - env SHELL="$(which bash)" bash n-install.sh -y #Force the installation to bash + env SHELL="$(command -v bash)" bash n-install.sh -y #Force the installation to bash N_PATH="$(cat ${HOME}/.bashrc | grep "^.*N_PREFIX.*$" | cut -d'#' -f 1)" echo "${N_PATH}" | sudo tee "${NPM_PROFILE}" diff --git a/pengwin-setup.d/services.sh b/pengwin-setup.d/services.sh index d97dc278..b4c9d035 100644 --- a/pengwin-setup.d/services.sh +++ b/pengwin-setup.d/services.sh @@ -5,6 +5,13 @@ source "$(dirname "$0")/common.sh" "$@" declare SetupDir +####################################### +# description +# Arguments: +# None +# Returns: +# 1 ... +####################################### function enable_rclocal() { if (confirm --title "rc.local" --yesno "Would you like to enable rc.local support for running scripts at Pengwin launch?" 10 60) ; then @@ -32,7 +39,7 @@ EOF #!/bin/bash # Check if we have Windows Path -if ( which cmd.exe >/dev/null ); then +if ( command -v cmd.exe >/dev/null ); then sudo ${cmd} fi @@ -48,6 +55,16 @@ EOF } +####################################### +# description +# Globals: +# NON_INTERACTIVE +# sshd_status +# Arguments: +# None +# Returns: +# 1 ... +####################################### function enable_ssh() { if (confirm --title "SSH Server" --yesno "Would you like to enable SSH Server?" 10 60) ; then @@ -120,7 +137,7 @@ EOF #!/bin/bash # Check if we have Windows Path -if ( which cmd.exe >/dev/null ); then +if ( command -v cmd.exe >/dev/null ); then sudo ${startSsh} fi @@ -133,6 +150,16 @@ EOF } +####################################### +# description +# Globals: +# SetupDir +# Arguments: +# None +# Returns: +# 1 ... +# ... +####################################### function main() { if [[ "$1" == "--enable-ssh" ]] ; then diff --git a/rpm/pengwin-setup.d/guilib.sh b/rpm/pengwin-setup.d/guilib.sh index d3903373..8d38da8f 100644 --- a/rpm/pengwin-setup.d/guilib.sh +++ b/rpm/pengwin-setup.d/guilib.sh @@ -35,7 +35,7 @@ if (confirm --title "GUI Libraries" --yesno "Would you like to install a base se #!/bin/sh # Check if we have Windows Path -if ( which cmd.exe >/dev/null ); then +if ( command -v cmd.exe >/dev/null ); then eval "\$(timeout 2s dbus-launch --auto-syntax)" fi diff --git a/rpm/pengwin-setup.d/services.sh b/rpm/pengwin-setup.d/services.sh index 89bc2b4a..23b2b2f1 100644 --- a/rpm/pengwin-setup.d/services.sh +++ b/rpm/pengwin-setup.d/services.sh @@ -48,6 +48,16 @@ declare SetupDir # } +####################################### +# description +# Globals: +# NON_INTERACTIVE +# sshd_status +# Arguments: +# None +# Returns: +# 1 ... +####################################### function enable_ssh() { if (confirm --title "SSH Server" --yesno "Would you like to install and enable SSH Server?" 10 60) ; then @@ -124,7 +134,7 @@ EOF #!/bin/bash # Check if we have Windows Path -if ( which cmd.exe >/dev/null ); then +if ( command -v cmd.exe >/dev/null ); then sudo ${startSsh} fi @@ -137,6 +147,14 @@ EOF } +####################################### +# description +# Arguments: +# 1 +# Returns: +# 1 ... +# ... +####################################### function main() { if [[ "$1" == "--enable-ssh" ]] ; then From 4407462392393c8bb5b6f1d3d9f4d4e7fca91d0c Mon Sep 17 00:00:00 2001 From: Carlos Ramirez Date: Wed, 6 Oct 2021 22:50:36 +0200 Subject: [PATCH 02/13] Fix fish scripts that use command --- pengwin-setup.d/guilib.sh | 2 +- pengwin-setup.d/lamp.sh | 2 +- pengwin-setup.d/nodejs.sh | 1 + pengwin-setup.d/services.sh | 4 ++-- pengwin-setup.d/shells.sh | 38 +++++++++++++++++++++++++++++++++ pengwin-setup.d/x410.sh | 2 +- rpm/pengwin-setup.d/services.sh | 2 +- 7 files changed, 45 insertions(+), 6 deletions(-) diff --git a/pengwin-setup.d/guilib.sh b/pengwin-setup.d/guilib.sh index 21c91d9e..7de3674a 100644 --- a/pengwin-setup.d/guilib.sh +++ b/pengwin-setup.d/guilib.sh @@ -47,7 +47,7 @@ EOF #!/bin/fish # Check if we have Windows Path -if command -v cmd.exe >/dev/null +if command -q cmd.exe for line in (timeout 2s dbus-launch | string match '*=*') set -l kv (string split -m 1 = -- \$line ) diff --git a/pengwin-setup.d/lamp.sh b/pengwin-setup.d/lamp.sh index c2e82a88..c262995a 100644 --- a/pengwin-setup.d/lamp.sh +++ b/pengwin-setup.d/lamp.sh @@ -125,7 +125,7 @@ EOF profile_start_lamp="/etc/profile.d/start-lamp.sh" sudo tee "${profile_start_lamp}" </dev/null ); then diff --git a/pengwin-setup.d/nodejs.sh b/pengwin-setup.d/nodejs.sh index 43da5c23..ed8ab86a 100644 --- a/pengwin-setup.d/nodejs.sh +++ b/pengwin-setup.d/nodejs.sh @@ -46,6 +46,7 @@ if [[ "$(command -v npm)" == $(wslpath 'C:\')* ]]; then fi sudo tee "${NPM_WIN_PROFILE}" </dev/null ); then diff --git a/pengwin-setup.d/services.sh b/pengwin-setup.d/services.sh index b4c9d035..e4813be1 100644 --- a/pengwin-setup.d/services.sh +++ b/pengwin-setup.d/services.sh @@ -36,7 +36,7 @@ EOF local profile_rclocal="/etc/profile.d/rclocal.sh" sudo tee "${profile_rclocal}" << EOF -#!/bin/bash +#!/bin/sh # Check if we have Windows Path if ( command -v cmd.exe >/dev/null ); then @@ -134,7 +134,7 @@ EOF local profile_startssh="/etc/profile.d/start-ssh.sh" sudo tee "${profile_startssh}" << EOF -#!/bin/bash +#!/bin/sh # Check if we have Windows Path if ( command -v cmd.exe >/dev/null ); then diff --git a/pengwin-setup.d/shells.sh b/pengwin-setup.d/shells.sh index 2ce0bce0..eb7ba8df 100644 --- a/pengwin-setup.d/shells.sh +++ b/pengwin-setup.d/shells.sh @@ -6,6 +6,19 @@ source "$(dirname "$0")/common.sh" "$@" #Imported from common.h declare SetupDir +####################################### +# description +# Globals: +# HOME +# USER +# ZDOTDIR +# ZSH_INSTALLED +# ZSH_SETUP +# dt +# rcfile +# Arguments: +# None +####################################### function zshinstall() { ZSH_SETUP=".zsh_pengwin" @@ -95,6 +108,14 @@ EOF fi } +####################################### +# description +# Globals: +# HOME +# USER +# Arguments: +# None +####################################### function fish_install() { createtmp install_packages fish @@ -118,6 +139,14 @@ function fish_install() { fi } +####################################### +# description +# Globals: +# HOME +# USER +# Arguments: +# None +####################################### function cshinstall() { if (confirm --title "csh" --yesno "Would you like to set csh as the default shell?" 8 55); then sudo chsh -s "$(command -v csh)" "${USER}" @@ -125,6 +154,15 @@ function cshinstall() { fi } +####################################### +# description +# Globals: +# SetupDir +# Arguments: +# None +# Returns: +# 1 ... +####################################### function installAndSetShell() { # shellcheck disable=SC2155 local menu_choice=$( diff --git a/pengwin-setup.d/x410.sh b/pengwin-setup.d/x410.sh index 07d42732..e40d143f 100644 --- a/pengwin-setup.d/x410.sh +++ b/pengwin-setup.d/x410.sh @@ -8,7 +8,7 @@ if [ -x "$(command -v x410.exe)" ]; then if (confirm --title "X410" --yesno "It seems that X410 is already installed on your machine. Would you like to start it every time that Pengwin launches?" 10 80) then echo "Configuring X410 to start on Pengwin launch" sudo bash -c 'cat > /etc/profile.d/02-x410.sh' << EOF -#!/bin/bash +#!/bin/sh if [ -n "\${WSL2}" ]; then (cmd-exe /c x410.exe /wm /public &> /dev/null &) diff --git a/rpm/pengwin-setup.d/services.sh b/rpm/pengwin-setup.d/services.sh index 23b2b2f1..c2e6ee52 100644 --- a/rpm/pengwin-setup.d/services.sh +++ b/rpm/pengwin-setup.d/services.sh @@ -131,7 +131,7 @@ EOF local profile_startssh="/etc/profile.d/start-ssh.sh" sudo tee "${profile_startssh}" << EOF -#!/bin/bash +#!/bin/sh # Check if we have Windows Path if ( command -v cmd.exe >/dev/null ); then From 1b01983470a1c7d132cc32855c6a46e998273bb8 Mon Sep 17 00:00:00 2001 From: Carlos Ramirez Date: Wed, 6 Oct 2021 23:34:36 +0200 Subject: [PATCH 03/13] Fix tests --- tests/pythonpi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pythonpi.sh b/tests/pythonpi.sh index 0d5ae7d9..e82c1455 100644 --- a/tests/pythonpi.sh +++ b/tests/pythonpi.sh @@ -4,7 +4,7 @@ source commons.sh function testPyEnv() { - run_pengwinsetup autoinstall PROGRAMMING PYTHONPI PYENV + run_pengwinsetup autoinstall PROGRAMMING PYTHONPI PYENV --debug for i in 'python3' 'make'; do package_installed $i From e3585524ef9f2e4ff5a9280570adfa6a1d26aaad Mon Sep 17 00:00:00 2001 From: Carlos Ramirez Date: Wed, 6 Oct 2021 23:38:56 +0200 Subject: [PATCH 04/13] Fix regression --- pengwin-setup | 2 +- tests/pythonpi.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pengwin-setup b/pengwin-setup index 845f77bd..dbef6089 100755 --- a/pengwin-setup +++ b/pengwin-setup @@ -1,6 +1,6 @@ #!/bin/bash -SetupDir="/mnt/f/WhitewaterFoundry/pengwin-setup/pengwin-setup.d" +SetupDir="/usr/local/pengwin-setup.d" export VERSION="1.2a" diff --git a/tests/pythonpi.sh b/tests/pythonpi.sh index e82c1455..0d5ae7d9 100644 --- a/tests/pythonpi.sh +++ b/tests/pythonpi.sh @@ -4,7 +4,7 @@ source commons.sh function testPyEnv() { - run_pengwinsetup autoinstall PROGRAMMING PYTHONPI PYENV --debug + run_pengwinsetup autoinstall PROGRAMMING PYTHONPI PYENV for i in 'python3' 'make'; do package_installed $i From a67862c2d881fc744965b8d954932641870314eb Mon Sep 17 00:00:00 2001 From: Carlos Rafael Ramirez Date: Wed, 3 Nov 2021 00:14:16 +0100 Subject: [PATCH 05/13] Install x11-utils as part of vcxsrv installation --- pengwin-setup.d/vcxsrv.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pengwin-setup.d/vcxsrv.sh b/pengwin-setup.d/vcxsrv.sh index 65636832..65ab01c2 100644 --- a/pengwin-setup.d/vcxsrv.sh +++ b/pengwin-setup.d/vcxsrv.sh @@ -10,7 +10,7 @@ if (confirm --title "VCXSRV" --yesno "Would you like to install the VcXsrv X-ser VcxsrvUrl="https://sourceforge.net/projects/vcxsrv/files/vcxsrv/${version}/vcxsrv-64.${version}.installer.exe/download" echo "Installing required install dependencies" - install_packages wget unzip p7zip-full mesa-utils + install_packages wget unzip p7zip-full mesa-utils x11-utils createtmp From a9bfbbc8d15b6542ae2918f1c58cd45599489f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ho=C3=A0ng?= <10150902+Smithienious@users.noreply.github.com> Date: Tue, 23 Nov 2021 11:34:50 +0700 Subject: [PATCH 06/13] Bump CPython to 3.10.0 --- pengwin-setup.d/pythonpi.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pengwin-setup.d/pythonpi.sh b/pengwin-setup.d/pythonpi.sh index 52752c2e..f34a202a 100644 --- a/pengwin-setup.d/pythonpi.sh +++ b/pengwin-setup.d/pythonpi.sh @@ -45,8 +45,8 @@ function install_pyenv() { eval "$(pyenv init --path)" eval "$(pyenv init -)" - pyenv install -s 3.9.7 - pyenv global 3.9.7 + pyenv install -s 3.10.0 + pyenv global 3.10.0 touch "${HOME}"/.should-restart From 7b3a52636efec3dec4b4d92301b9bd348390a587 Mon Sep 17 00:00:00 2001 From: Carlos Rafael Ramirez Date: Wed, 24 Nov 2021 15:59:15 +0100 Subject: [PATCH 07/13] Update pythonpi.sh --- tests/pythonpi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pythonpi.sh b/tests/pythonpi.sh index 0d5ae7d9..0abb6a58 100644 --- a/tests/pythonpi.sh +++ b/tests/pythonpi.sh @@ -11,7 +11,7 @@ function testPyEnv() { assertTrue "package $i is not installed" "$?" done - assertEquals "Python was not installed" "1" "$(run_command_as_testuser "${HOME}"/.pyenv/shims/python3 --version | grep -c '3.9')" + assertEquals "Python was not installed" "1" "$(run_command_as_testuser "${HOME}"/.pyenv/shims/python3 --version | grep -c '3.10')" assertEquals "Pyenv variables are not setup" "1" "$(grep -c '^[^#]*\bPYENV_ROOT.*/.pyenv' "${HOME}"/.bashrc)" assertEquals "Pyenv variables are not setup" "1" "$(grep -c '^[^#]*\bPATH.*PYENV_ROOT.*/bin' "${HOME}"/.bashrc)" From c4005de6812fe61b6953876751094da1e90e7e6a Mon Sep 17 00:00:00 2001 From: Carlos Ramirez Date: Tue, 7 Dec 2021 19:45:05 +0100 Subject: [PATCH 08/13] Fix #359 SDKMan installation breaks XRDP --- pengwin-setup.d/java.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pengwin-setup.d/java.sh b/pengwin-setup.d/java.sh index 05a676d9..f981fa64 100644 --- a/pengwin-setup.d/java.sh +++ b/pengwin-setup.d/java.sh @@ -12,6 +12,10 @@ if (confirm --title "Java" --yesno "Would you like to Install SDKMan to manage a sudo tee "/etc/profile.d/sdkman.sh" < Date: Tue, 7 Dec 2021 19:51:53 +0100 Subject: [PATCH 09/13] Bump to Python 3.10.1 also updated all installation types --- pengwin-setup.d/pythonpi.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pengwin-setup.d/pythonpi.sh b/pengwin-setup.d/pythonpi.sh index f34a202a..3f5f17f8 100644 --- a/pengwin-setup.d/pythonpi.sh +++ b/pengwin-setup.d/pythonpi.sh @@ -5,7 +5,7 @@ source "$(dirname "$0")/common.sh" "$@" function install_pyenv() { - if (confirm --title "PYTHON" --yesno "Would you like to download and install Python 3.9 with pyenv?" 8 70); then + if (confirm --title "PYTHON" --yesno "Would you like to download and install Python 3.10 with pyenv?" 8 70); then echo "Installing PYENV" createtmp install_packages make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev @@ -39,14 +39,14 @@ function install_pyenv() { echo 'status --is-interactive; and pyenv init -| source' >>"${HOME}"/.config/fish/config.fish fi - echo "Installing Python 3.9" + echo "Installing Python 3.10" export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init --path)" eval "$(pyenv init -)" - pyenv install -s 3.10.0 - pyenv global 3.10.0 + pyenv install -s 3.10.1 + pyenv global 3.10.1 touch "${HOME}"/.should-restart @@ -58,10 +58,10 @@ function install_pyenv() { function install_pythonpip() { - if (confirm --title "PYTHON" --yesno "Would you like to download and install Python 3.9, IDLE, and the pip package manager?" 8 90); then + if (confirm --title "PYTHON" --yesno "Would you like to download and install Python 3.10, IDLE, and the pip package manager?" 8 90); then echo "Installing PYTHONPIP" createtmp - install_packages build-essential python3.9 python3.9-distutils idle-python3.9 python3-pip python3-venv + install_packages build-essential python3.10 python3.10-distutils idle-python3.10 python3-pip python3-venv pip3 install -U pip touch "${HOME}"/.should-restart @@ -74,10 +74,10 @@ function install_pythonpip() { function install_poetry() { - if (confirm --title "PYTHON" --yesno "Would you like to download and install Python 3.9, IDLE, and the poetry package manager?" 9 90); then + if (confirm --title "PYTHON" --yesno "Would you like to download and install Python 3.10, IDLE, and the poetry package manager?" 9 90); then echo "Installing POETRY" createtmp - install_packages build-essential python3.9 python3.9-distutils idle-python3.9 python3-venv + install_packages build-essential python3.10 python3.10-distutils idle-python3.10 python3-venv curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 source $HOME/.poetry/env poetry self update @@ -96,9 +96,9 @@ function main() { local menu_choice=$( menu --title "Python" --radiolist --separate-output "Python install options\n[SPACE to select, ENTER to confirm]:" 12 75 3 \ - "PYENV" 'Python 3.9 with pyenv ' off \ - "PYTHONPIP" 'Python 3.9, IDLE, and the pip package manager ' off \ - "POETRY" 'Python 3.9, IDLE, and the poetry package manager ' off + "PYENV" 'Python 3.10 with pyenv ' off \ + "PYTHONPIP" 'Python 3.10, IDLE, and the pip package manager ' off \ + "POETRY" 'Python 3.10, IDLE, and the poetry package manager ' off # shellcheck disable=SC2188 3>&1 1>&2 2>&3 From f5d55cacdba54e333adc38fc945a969d519f8974 Mon Sep 17 00:00:00 2001 From: Carlos Ramirez Date: Tue, 7 Dec 2021 20:00:31 +0100 Subject: [PATCH 10/13] Fix #359 SDKMan installation breaks XRDP --- pengwin-setup.d/java.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pengwin-setup.d/java.sh b/pengwin-setup.d/java.sh index f981fa64..e8b920b9 100644 --- a/pengwin-setup.d/java.sh +++ b/pengwin-setup.d/java.sh @@ -12,7 +12,7 @@ if (confirm --title "Java" --yesno "Would you like to Install SDKMan to manage a sudo tee "/etc/profile.d/sdkman.sh" < Date: Tue, 7 Dec 2021 20:16:57 +0100 Subject: [PATCH 11/13] Upgrade .NET to 6.0 --- pengwin-setup.d/dotnet.sh | 2 +- pengwin-setup.d/uninstall/dotnet.sh | 2 +- tests/dotnet.sh | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pengwin-setup.d/dotnet.sh b/pengwin-setup.d/dotnet.sh index 0025303c..477b7725 100644 --- a/pengwin-setup.d/dotnet.sh +++ b/pengwin-setup.d/dotnet.sh @@ -24,7 +24,7 @@ if (confirm --title "DOTNET" --yesno "Would you like to download and install the update_packages - install_packages dotnet-sdk-5.0 + install_packages dotnet-sdk-6.0 cleantmp if (confirm --title "NUGET" --yesno "Would you like to download and install NuGet?" 8 50) ; then diff --git a/pengwin-setup.d/uninstall/dotnet.sh b/pengwin-setup.d/uninstall/dotnet.sh index 0c2c164c..274c451b 100644 --- a/pengwin-setup.d/uninstall/dotnet.sh +++ b/pengwin-setup.d/uninstall/dotnet.sh @@ -7,7 +7,7 @@ function main() { echo "Uninstalling dotnet" - remove_package "dotnet-sdk-3.1" "dotnet-sdk-5.0" "nuget" + remove_package "dotnet-sdk-3.1" "dotnet-sdk-5.0" "dotnet-sdk-6.0" "nuget" echo "Removing leftover dotnet cli tools directory..." rem_dir "$HOME/.dotnet" diff --git a/tests/dotnet.sh b/tests/dotnet.sh index 32979957..3abf774b 100755 --- a/tests/dotnet.sh +++ b/tests/dotnet.sh @@ -11,12 +11,12 @@ function testMain() { run_pengwinsetup autoinstall PROGRAMMING DOTNET - for i in 'dotnet-sdk-5.0' 'nuget'; do + for i in 'dotnet-sdk-6.0' 'nuget'; do package_installed $i assertTrue "package $i is not installed" "$?" done - assertEquals ".NET Core was not installed" "1" "$(run_command_as_testuser /usr/bin/dotnet --version | grep -c '5.0')" + assertEquals ".NET Core was not installed" "1" "$(run_command_as_testuser /usr/bin/dotnet --version | grep -c '6.0')" command -v /usr/bin/nuget assertEquals "NUGet was not installed" "0" "$?" @@ -31,7 +31,7 @@ function testUninstall() { run_pengwinsetup autoinstall UNINSTALL DOTNET - for i in 'dotnet-sdk-5.0' 'nuget'; do + for i in 'dotnet-sdk-6.0' 'nuget'; do package_installed $i assertFalse "package $i is not uninstalled" "$?" done From 6b922a0f2f5883cb3bd3b99b8575019fdac39440 Mon Sep 17 00:00:00 2001 From: Carlos Ramirez Date: Tue, 7 Dec 2021 20:33:20 +0100 Subject: [PATCH 12/13] Revert python to 3.9 when it is installed via apt --- pengwin-setup.d/pythonpi.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pengwin-setup.d/pythonpi.sh b/pengwin-setup.d/pythonpi.sh index 3f5f17f8..df81eefe 100644 --- a/pengwin-setup.d/pythonpi.sh +++ b/pengwin-setup.d/pythonpi.sh @@ -58,10 +58,10 @@ function install_pyenv() { function install_pythonpip() { - if (confirm --title "PYTHON" --yesno "Would you like to download and install Python 3.10, IDLE, and the pip package manager?" 8 90); then + if (confirm --title "PYTHON" --yesno "Would you like to download and install Python 3.9, IDLE, and the pip package manager?" 8 90); then echo "Installing PYTHONPIP" createtmp - install_packages build-essential python3.10 python3.10-distutils idle-python3.10 python3-pip python3-venv + install_packages build-essential python3.9 python3.9-distutils idle-python3.9 python3-pip python3-venv pip3 install -U pip touch "${HOME}"/.should-restart @@ -74,10 +74,10 @@ function install_pythonpip() { function install_poetry() { - if (confirm --title "PYTHON" --yesno "Would you like to download and install Python 3.10, IDLE, and the poetry package manager?" 9 90); then + if (confirm --title "PYTHON" --yesno "Would you like to download and install Python 3.9, IDLE, and the poetry package manager?" 9 90); then echo "Installing POETRY" createtmp - install_packages build-essential python3.10 python3.10-distutils idle-python3.10 python3-venv + install_packages build-essential python3.9 python3.9-distutils idle-python3.9 python3-venv curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 source $HOME/.poetry/env poetry self update @@ -97,8 +97,8 @@ function main() { menu --title "Python" --radiolist --separate-output "Python install options\n[SPACE to select, ENTER to confirm]:" 12 75 3 \ "PYENV" 'Python 3.10 with pyenv ' off \ - "PYTHONPIP" 'Python 3.10, IDLE, and the pip package manager ' off \ - "POETRY" 'Python 3.10, IDLE, and the poetry package manager ' off + "PYTHONPIP" 'Python 3.9, IDLE, and the pip package manager ' off \ + "POETRY" 'Python 3.9, IDLE, and the poetry package manager ' off # shellcheck disable=SC2188 3>&1 1>&2 2>&3 From 4f4e11dba7db9d83aa495bc284cd26abaee4d44f Mon Sep 17 00:00:00 2001 From: Carlos Ramirez Date: Tue, 7 Dec 2021 21:03:50 +0100 Subject: [PATCH 13/13] Remove the PATH warning installing pip --- pengwin-setup.d/pythonpi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pengwin-setup.d/pythonpi.sh b/pengwin-setup.d/pythonpi.sh index df81eefe..3ca43ce7 100644 --- a/pengwin-setup.d/pythonpi.sh +++ b/pengwin-setup.d/pythonpi.sh @@ -62,7 +62,7 @@ function install_pythonpip() { echo "Installing PYTHONPIP" createtmp install_packages build-essential python3.9 python3.9-distutils idle-python3.9 python3-pip python3-venv - pip3 install -U pip + pip3 install -U pip --no-warn-script-location touch "${HOME}"/.should-restart