Date: Wed, 20 May 2020 12:22:00 +0200 From: Polytropon <freebsd@edvax.de> To: "Steve O'Hara-Smith" <steve@sohara.org> Cc: listac@nebelschwaden.de, freebsd-questions@freebsd.org Subject: Re: Moving sources (base/ports) from /usr Message-ID: <20200520122200.aea34a98.freebsd@edvax.de> In-Reply-To: <20200520110833.f47610a48f0f28dd563c13aa@sohara.org> References: <8d48921e-7af1-9313-0781-4ba4bd9c1f10@nebelschwaden.de> <ee6f9d59-9ac3-5d1e-baec-405fc1b24ab2@nebelschwaden.de> <20200520110833.f47610a48f0f28dd563c13aa@sohara.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 20 May 2020 11:08:33 +0100, Steve O'Hara-Smith wrote: > On Wed, 20 May 2020 11:52:00 +0200 > Ede Wolf <listac@nebelschwaden.de> wrote: > > > > That makes sense it isn't being picked up by make. > > > > Sure, once you think about it. > > > > But here is the strange part. I've exported SOURCEDIR via /etc/profile > > Which means that it will be picked up by /bin/sh. If invoked as a login shell; "man sh" says: Invocation If no arguments are present and if the standard input of the shell is connected to a terminal (or if the -i option is set), the shell is considered an interactive shell. An interactive shell generally prompts before each command and handles programming and command errors differently (as described below). When first starting, the shell inspects argument 0, and if it begins with a dash (-), the shell is also considered a login shell. This is normally done automatically by the system when the user first logs in. A login shell first reads commands from the files /etc/profile and then .profile in a user's home directory, if they exist. If the environment variable ENV is set on entry to a shell, or is set in the .profile of a login shell, the shell then subjects its value to parameter expansion and arithmetic expansion and reads commands from the named file. Therefore, a user should place commands that are to be executed only at login time in the .profile file, and commands that are executed for every shell inside the ENV file. The user can set the ENV variable to some file by placing the following line in the file .profile in the home directory, substituting for .shrc the filename desired: ENV=$HOME/.shrc; export ENV Maybe it helps setting SOURCEDIR in /root/.shrc, assuming that root will execute the commands (and uses sh for that). > > and it is set. However, mergemaster does not recognize it. > > Then I export the same variable again on the command line and it works: > > By default root login uses /bin/csh which doesn't load /etc/profile > but rather /etc/csh.cshrc and /etc/csh.login. That was my suspicion too, but in case it was a C shell, the commands for re-setting and re-exporting SOURCEDIR would have failed, as csh requires a different syntax. So it seems that it's really sh. :-) However, the presented behaviour is quite strange. It has been shown (!) that $SOURCEDIR is somehow set, but mergemaster requires it to be set again? -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200520122200.aea34a98.freebsd>