From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A9057138222 for ; Tue, 3 May 2016 09:31:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7404421C001; Tue, 3 May 2016 09:31:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 08F4421C001 for ; Tue, 3 May 2016 09:31:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 61416340815 for ; Tue, 3 May 2016 09:31:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 103D8331 for ; Tue, 3 May 2016 09:31:19 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1462267868.2bb3c6940c3000924d145515832797ae5bf29f31.grobian@gentoo> Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/ X-VCS-Repository: repo/proj/prefix X-VCS-Files: scripts/startprefix.in X-VCS-Directories: scripts/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 2bb3c6940c3000924d145515832797ae5bf29f31 X-VCS-Branch: master Date: Tue, 3 May 2016 09:31:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 74485ad3-5449-49c8-b00e-39816cc937cc X-Archives-Hash: 213e4ff7a8f3bd557f6c2c5d561fd056 commit: 2bb3c6940c3000924d145515832797ae5bf29f31 Author: Fabian Groffen gentoo org> AuthorDate: Tue May 3 09:31:08 2016 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Tue May 3 09:31:08 2016 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=2bb3c694 scripts/startprefix: retain some more useful env vars scripts/startprefix.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/startprefix.in b/scripts/startprefix.in index aafd04d..861f02d 100644 --- a/scripts/startprefix.in +++ b/scripts/startprefix.in @@ -37,9 +37,15 @@ fi # give a small notice echo "Entering Gentoo Prefix ${EPREFIX}" # start the login shell, clean the entire environment but what's needed +RETAIN="HOME=$HOME TERM=$TERM USER=$USER SHELL=$SHELL" # PROFILEREAD is necessary on SUSE not to wipe the env on shell start -[[ -n ${PROFILEREAD} ]] && DOPROFILEREAD="PROFILEREAD=${PROFILEREAD}" -env -i HOME=$HOME TERM=$TERM USER=$USER SHELL=$SHELL $DOPROFILEREAD $SHELL -l +[[ -n ${PROFILEREAD} ]] && RETAIN+=" PROFILEREAD=$PROFILEREAD" +# ssh-agent is handy to keep, of if set, inherit it +[[ -n ${SSH_AUTH_SOCK} ]] && RETAIN+=" SSH_AUTH_SOCK=$SSH_AUTH_SOCK" +# if we're on some X terminal, makes sense to inherit that too +[[ -n ${DISPLAY} ]] && RETAIN+=" DISPLAY=$DISPLAY" +# do it! +env -i $RETAIN $SHELL -l # and leave a message when we exit... the shell might return non-zero # without having real problems, so don't send alarming messages about # that