I modified the LESS variable in /etc/env.d/70less so I have some info displayed. And then I did env-update which updated my /etc/profile.env. After reboot though profile.env lacked the changes I made (LESS wasn't there). So I did env-update again and it updated profile.env just fine. But after every reboot LESS was gone again. I found out that the problem was caused by /sbin/rc-envupdate.sh that was called on reboot from 'bootmisc' in runlevel 'boot' (when it says "Updating Environment"). After some debugging I found out that, when rc-envupdate.sh parses the files in /etc/env.d it creates a list of variables it finds. But every variable name is included once in the list so it knows what to write to profile.env . The ambiguity check is pretty simple: the first match of current variable is deleted from the list of already known variables and the resulting list is compared to the original list. If they are equal then we have a new variable, if they are not equal then we have found an already known variable. Now to the problem. In /etc/env.d/00basic there is a variable called LESSOPEN. But LESS is in 70less so it is parsed later. When rc-envupdate.sh was checking the list for LESS it simply deleted the first occurance of LESS which was a part of LESSOPEN. This left OPEN in the list. The ambiguity check returned false (different strings) ==> not a new variable. It means that rc-envupdate.sh doesn't try to match whole words but merely substrings. On the other hand, env-update works fine as far as this issue is concerned. A patch is attached. PS. Is rc-envupdate.sh necessary? env-update works fine (except that it's slower) Reproducible: Always Steps to Reproduce: 1. Add a variable to /etc/env.d/XXsomething 2. Add a second variable which name is a substring of the first variable to /etc/env.d/YYsomething where YY > XX 3. run /sbin/rc-envupdate.sh and backup the generated /etc/profile.env. 4. run env-update 5. compare the results
Created attachment 9410 [details, diff] A patch to /sbin/rc-envupdate.sh
Just forgot to mention. I have just installed Gentoo 1.4_rc3 but I think this bug is as well related to erlier Gentoo releases. (There is no option for 1.4_rc3 in "Version" dropdown menu in bugzilla.)
Hi. This bug and others have already been fixed, and are in baselayout-1.8.6.3, which will hopefully be out and ready for use after I have verified that it is much more newbie proof in upgrading to it.
I did though apply to the old version which will be installed if we cannot compile the gawk module, thanks.