From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: Re: Profiles/manifests-related command line interface enhancements Date: Thu, 24 Oct 2019 15:23:51 -0400 Message-ID: <875zkevtel.fsf@netris.org> References: <87mudrxvs8.fsf@ambrevar.xyz> <87d0emwm95.fsf@netris.org> <87imoewks8.fsf@ambrevar.xyz> <20191024184246.014d810e@scratchpost.org> <87tv7yt3e2.fsf@ambrevar.xyz> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:56993) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNijD-0002oc-MY for guix-devel@gnu.org; Thu, 24 Oct 2019 15:25:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNijC-0007SY-I7 for guix-devel@gnu.org; Thu, 24 Oct 2019 15:24:59 -0400 Received: from world.peace.net ([64.112.178.59]:58376) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNijC-0007SP-Dq for guix-devel@gnu.org; Thu, 24 Oct 2019 15:24:58 -0400 In-Reply-To: <87tv7yt3e2.fsf@ambrevar.xyz> (Pierre Neidhardt's message of "Thu, 24 Oct 2019 20:16:53 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Pierre Neidhardt Cc: guix-devel@gnu.org Hi Pierre, Pierre Neidhardt writes: > Danny Milosavljevic writes: > >> On Thu, 24 Oct 2019 11:32:55 +0200 >> Pierre Neidhardt wrote: >> >>>- The inverse command, =guix deactivate /path/to/profile=. >>> This can be useful to deactivate a profile that was activated during login. >> >> That is not composable and sounds like a HUGE effort for what would otherwise >> one "exit" command. > > Why isn't it composable? > > It does not seem too hard: if I'm not mistaken, it boils down to > removing all environment entries that match a given profile. It wouldn't be sufficient to remove them. You'd have to restore the previous settings. For example, if we remove the settings for PATH, MANPATH, etc, without restoring the previous settings, I doubt that you would be pleased with the results. It seems to me that the most natural approach to allow restoring the previous environment settings is to launch a subshell when you activate a profile. That subshell can then simply be exited to restore the previous settings. Does that make sense? Regards, Mark