Subject: Re: rollback procedure, was: what determines cygwin path?
From: "Max Bowsher" <[email-masked]>
To: "Qwer Zxcv" <[email-masked]>
Cc: <[email-masked]>
Date: Sat, 26 Apr 2003 01:00:54 +0100

Qwer Zxcv wrote:
> Qwer Zxcv wrote:
>>>>> So what I'd like to know is, how is cygwin's path determined?
>>>>> (Apparently not entirely by the windows path, at least not by
>>>>> default.) And how do I fix it?
>
> Max Bowsher wrote:
>>>> Windows + /etc/profile + any user customisation.
>
> Max Bowsher wrote (later):
>>> Anything you yourself have deliberately changed - e.g. ~/.profile,
>>> ~/.bash_profile, etc.
>
> OK, so to enable successful rollback, I should be sure to keep these
> in a home directory out of the cygwin tree, correct?

Well, I keep my home in /home, but yes, you can keep them out of the cygwin
tree if you want.

> I'm presuming
> setup.exe is not going to try to read or write them.

Correct.

> Also:
>
> Igor Pechtchanski wrote:
>> The "mount.exe" program will run even if the mounts are all gone (as
>> long as it's invoked via an absolute path or from the current
>> directory and cygwin1.dll is in the same directory).
>
>> It's been stated time and time again on this list that going to the
>> registry is an unsafe and nonportable way of manipulating the mount
>> table.
>
> OK, but please keep in mind that (I suspect) lots of folks only read
> this list when they're having problems :-)
>
>> Especially when mount.exe does a very adequate job. There already
>> are plans (and code, AFAIK, though not in the production system) to
>> store the mount table in a file instead of in the registry. Please
>> manipulate the mount table only by using mount.exe (or setup.exe).
>
> Will do. I even learned what Max meant by 'mount -m' :-)
>
> So, to ensure roll-back-ability, one should:
>
> *** As part of good cygwin hygeine:
>
> * Create/use a home directory outside the cygwin install tree.

Not really. Its quite safe (and IMO neater) to leave your home in /home,
provided you don't decide to delete your entire Cygwin tree and forget /home
is inside it.

> * Ensure cygwin references precede windows references in one's windows
>   path (Control Panel>System>Advanced>Environment Variables>System
>   Variables>Path).

Not really. Only if you make regular use of Cygwin tools from non-Cygwin
shells.

> * Ensure customizations occur only in dotfiles in one's home
>   directory.

This IS a good idea. Personally, I keep config files that I change inside my
home dir, and symlink to them. That way I can delete everything except /home
and /usr/local if I want to do a clean install.

> *** Immediately before installing any new version:
>
> * Note any customizations that affect $PATH. This could be done by,
>   e.g., running
>
> find . -type f | grep -ni 'path'
>
>   from one's homedir.
>
> * Know where cygwin1.dll is installed, and ensure that 'mount' runs
>   from that directory.
>
> * Record the output of "mount -m", i.e. the mount commands needed to
>   restore one's currently-working mount points.
>
> *** To rollback:
>
> 0 Change windows path to point (only) to the old version. Cygwin
>   references should precede windows references.
>
> 1 Run 'mount' using the previously recorded commands.
>
> 2 Find or recreate a shortcut to one's old bash-running batchfile.
>
> 3 Run bash, check for weirdness.
>
> 4 'cygcheck -svr', check for weirdness.
>
> Correct? Am I missing anything major? Did I get anything else wrong?

Why not just upgrade your Cygwin install, and reinstall previous package
versions if something breaks? Unless you are running a mission-critical
server, I think you are making work for yourself.

Max.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/