Let me see if I understand what is going on here: We are debeating whether to:
1) Modify /etc/profile, which is not installed via a package, but is created directly by setup.exe. 2) Add two scripts, one for bash-style shells and one for c-shell-style shells to /etc/profile.d/. These scripts are processed by /etc/profile. We would add this new scripts to an XFree86 package, probably XFree86-bin, and we would install these scripts via a post-install script if they were not already present (so we do not overwrite modifications). Of all the arguments for/against the two methods, so far only one seems to be a sticking point that essentially decides how we will do this: There is no guarantee that the sub-script in /etc/profile.d/ that adds /usr/X11R6/bin to the path will be executed before some other shell script, that may be added at a later date to /etc/profile.d/, that requires that the path to the X11R6 binaries already be set. In order to allow other scripts in /etc/profile.d/ to assume that the path to the X11R6 binaries is known, we must set the path to the binaries in /etc/profile before the /etc/profile.d/ scripts are processed. I therefore throw my vote 100% behind modifying the /etc/profile script to add /usr/X11R6/bin to the path, if that directory exists. Robert Collins had said something about pulling the /etc/profile script out of setup.exe and having it installed as a stand-alone package. Was this the task that two people had volunteered for? If so, shall we wait until this package is made before we propose any changes to /etc/profile, or should we go ahead and submit a patch for the /etc/profile that is distributed with setup.exe now? Hopefully I haven't confused anything here. I have not commented until now because I had no idea what was going on with all of this profile[.d] stuff, but I think I have a pretty good grasp of it now. Harold Jehan wrote: > Nicholas Wourms wrote: > >> As a rule of thumb, packages should *never* modify the /etc/profile >> script (even if you do back it up). This is a big no-no, as most >> *nix people would tell you. If you insist on getting into a >> discussion on why this is, then so be it. Instead, create 2 scripts >> (a csh and a sh) and drop them into the /etc/profile.d/ directory. > > > I don't like modifying /etc/profile either because I don't think there > any clean way to do it. But if you read the thread I summarized, someone > said that Unixes set X path in /etc/profile. And this make sense to me: > there are no guarantees on the order of execution of the scripts in > /etc/profile.d. What if one of them looks for X and doesn't find it > because the path has not yet been set? As you said in our heated thread > last time, X is quite an important package and we will have more and > more package depending on it. > If the 2 scripts in profile.d are preferred, then I already sent them > less than two weeks ago. > >> This way we play it safe and every one is happy. Also, your scripts >> should check to see if the path has already been set, if it has, then >> don't set it again. Remeber, the more entries in the path, the >> slower Cygwin will operate. > > > If you read the scripts carefully, you'll see that I do check if the > path exists. I check in the install script if /etc/profile has a line of > the form "...PATH=.../usr/X11R6/bin...". Sure it doesn't handle every > single cases (what if someone uses a temporary variable). But it should > handle 99.99% of the cases. If such a line is already in /etc/profile, I > don't change it. > I also check the path in /etc/profile script itself using the echo/grep > line. > > Jehan > > >
