From fb4ed5498044d8ff8fbd5328d4c34ae71d21dfe1 Mon Sep 17 00:00:00 2001 From: Niklas Holm Date: Tue, 13 Feb 2018 19:09:05 +0100 Subject: [PATCH 1/4] Fix issue #1107 - Only cd to $HOME when started from msys2_shell.cmd --- filesystem/05-home-dir.post | 3 ++- filesystem/msys2_shell.cmd | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/filesystem/05-home-dir.post b/filesystem/05-home-dir.post index 19fad50b..54ceb84b 100644 --- a/filesystem/05-home-dir.post +++ b/filesystem/05-home-dir.post @@ -252,7 +252,8 @@ maybe_create_home () # Make sure we start in home unless invoked by CHERE if [ ! -z "${CHERE_INVOKING}" ]; then unset CHERE_INVOKING - else + elif [ "${CD_HOME}" = "yes" ]; then + unset CD_HOME cd "${HOME}" || echo "WARNING: Failed attempt to cd into ${HOME}!" fi } diff --git a/filesystem/msys2_shell.cmd b/filesystem/msys2_shell.cmd index 2495a46e..98c3c504 100644 --- a/filesystem/msys2_shell.cmd +++ b/filesystem/msys2_shell.cmd @@ -68,6 +68,8 @@ if "%MSYSTEM%" == "MINGW32" ( set "CONTITLE=MSYS2 MSYS" ) +set CD_HOME=yes + if "x%MSYSCON%" == "xmintty.exe" goto startmintty if "x%MSYSCON%" == "xconemu" goto startconemu if "x%MSYSCON%" == "xdefterm" goto startsh From 000e81ffcbb6a3855c814434f8ea318e2900f7ef Mon Sep 17 00:00:00 2001 From: Niklas Holm Date: Wed, 14 Feb 2018 09:58:32 +0100 Subject: [PATCH 2/4] Change comment and always unset CD_HOME --- filesystem/05-home-dir.post | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/filesystem/05-home-dir.post b/filesystem/05-home-dir.post index 54ceb84b..553cebda 100644 --- a/filesystem/05-home-dir.post +++ b/filesystem/05-home-dir.post @@ -249,13 +249,11 @@ maybe_create_home () # c:\msys\usr\bin\bash -c "cd '%curdir'; export # CHERE_INVOKING=1; exec /usr/bin/bash --login -i" # - # Make sure we start in home unless invoked by CHERE - if [ ! -z "${CHERE_INVOKING}" ]; then - unset CHERE_INVOKING - elif [ "${CD_HOME}" = "yes" ]; then - unset CD_HOME + # Make sure we start in home if invoked through msys2_shell.cmd without -here option + if [ -z "${CHERE_INVOKING}" -a "${CD_HOME}" = "yes" ]; then cd "${HOME}" || echo "WARNING: Failed attempt to cd into ${HOME}!" fi + unset CHERE_INVOKING CD_HOME } maybe_create_home From 032e31971f68bddaab76759f0eab38d2d22892f5 Mon Sep 17 00:00:00 2001 From: Niklas Holm Date: Wed, 14 Feb 2018 09:59:22 +0100 Subject: [PATCH 3/4] cd back to current dir after copying skeleton --- filesystem/05-home-dir.post | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/filesystem/05-home-dir.post b/filesystem/05-home-dir.post index 553cebda..9aa39761 100644 --- a/filesystem/05-home-dir.post +++ b/filesystem/05-home-dir.post @@ -227,14 +227,16 @@ maybe_create_home () echo echo "They will never be overwritten nor automatically updated." echo + local cur_pwd="$PWD" cd /etc/skel || echo "WARNING: Failed attempt to cd into /etc/skel!" local f= /usr/bin/find . -type f | while read f; do - local fDest=${f#.} + local fDest="${f#.}" if [ ! -e "${HOME}${fDest}" -a ! -L "${HOME}${fDest}" ]; then - /usr/bin/install -D -p -v "${f}" "${HOME}/${fDest}" + /usr/bin/install -D -p -v "${f}" "${HOME}${fDest}" fi done + cd "${cur_pwd}" else echo "${HOME} could not be created." { [ -d "${TEMP}" ] && HOME="${TEMP}"; } || From 83afbb1e112841906a9a0ac6e0a13a52aa2ddd24 Mon Sep 17 00:00:00 2001 From: Niklas Holm Date: Wed, 14 Feb 2018 10:07:25 +0100 Subject: [PATCH 4/4] Bump pkgver --- filesystem/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesystem/PKGBUILD b/filesystem/PKGBUILD index 2b338343..d3e5a184 100644 --- a/filesystem/PKGBUILD +++ b/filesystem/PKGBUILD @@ -4,7 +4,7 @@ # Contributor: Alethea Rose pkgname=filesystem -pkgver=2017.05 +pkgver=2018.02 pkgrel=1 pkgdesc='Base filesystem' arch=('i686' 'x86_64')