This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug in startxwin.bat after installing with setup.exe in win98SE


I hate to jump into the middle of a religious argument (which this is turning out to be) but it seems to me that a plausible solution would be to urge the maintainers of the cygwin setup program to define a CYGWIN_ROOT environment variable for us. Cygwin setup is already putting stuff in the registry, isn't it, so why not this?

You could then modify the startxwin.bat and startxwin.sh scripts such that they don't attempt to assign CYGWIN_ROOT if it already has a value.

From: Harold L Hunt <huntharo@msu.edu>
To: cygwin-xfree@cygwin.com
Subject: Re: Bug in startxwin.bat after installing with setup.exe in win98SE
Date: Fri, 12 Jul 2002 16:37:56 EDT

Jehan <nahor@bravobrava.com> said:

> Harold L Hunt wrote:
> > Okay, if you are so smart, explain to me how I can put a drive letter into a
> > batch file that is expected to work on computers where Cygwin could be
> > installed on ``c:\cygwin'' or ``d:\cygwin''? I certainly could not put ``c''
> > as the drive, nor could I put ``d'' as the drive. So, what do you suggest?
>
> First, I'm not trying to bash you (how could I, we are fellow
> Cgwin/XFree programmers *grin*) but I'm trying to understand your
> motivation. So here is my question: in what sense is "\cygwin" better
> "c:\cygwin"? I mean, I used to install cygwin in "c:\program
> files\cygwin". So neither "\cygwin" nor "c:\cygwin" would work. But
> then, when I see just "\cygwin", I think a unix path (I know, the "\"
> isn't a "/", but I'm a little dumb sometimes :p). So at first, I
> overlooked it. I'm pretty sure that if I had seend "c:\cygwin", I would
> have thought of changing it.
> The other thing too is that "\cygwin" is sort of a bastard. It's not a
> full path because it doesn't have the drive letter. It's not a relative
> path because it doesn't start from the current directory but from the
> root of the current drive.
> Last, with "\cygwin", the batch file works sometimes (the current drive
> is where cygwin is) and sometimes it doesn't (wrong current drive). As a
> programmer, I prefer things that always crash or never do.
> So, in this light, as my personal opinion (which doesn't matter anymore
> now that I have cygwin in "c:\cygwin" ;p ), would be to use an full
> absolute path.
>

Unfortunately you cannot use a relative path (e.g. ..\..\.., which gets \bin
appended on it to point to /bin) because that causes bash (or whatever shell
you launch in xterm) to have a relative path the Cygwin binaries. Thus you
can no longer run Cygwin binaries if you change out of the /usr/X11R6/bin
directory, because your relative path to the Cygwin binaries is now incorrect.

So, we have to use an absolute path, which is why why need something like
c:\cygwin. We go one further an change this to \cygwin because we used to get
weekly complaints like, ``yikes, cygwin1.dll could not be found, cause i am
l33t and i installed to d:\cygwin''. We do not get regular complaints
anymore, so \cygwin is an improvement over c:\cygwin.

Now, about not being able to see things that you are looking for in a file: I
wrote two paragraphs! of comments about setting the path correctly, and in
those comments there does appear a c:\cygwin. I cannot help someone if they
are skimming so fast as to completely miss all of that.

I will admit one current problem with startxwin.bat: the User's Guide is out
of date so we do not recommend that new users read it to install
Cygwin/XFree86. Unfortunately this means that people do not see, repeatedly,
my recommendations that they install Cygwin in c:\cygwin that are in the
User's Guide.

One idea is that we could try to parse the return from ``chdir'', which gives,
for example:
C:\cygwin\usr\X11R6\bin>chdir
C:\cygwin\usr\X11R6\bin


It would be pretty easy to construct a location for /bin or /usr/bin from the
output of chdir, but then we are back to the Catch-22 that we would need
Cygwin binaries in order to find the location of the Cygwin binaries.

>
> > Okay, okay, so you are thinking, ``just use cygpath, duh''. However, if I
> > could use ``cygpath'', then that implies that I already know where the Cygwin
> > binaries are located since I just ran one of them. But, I don't know where
> > the Cygwin binaries are located, as that is why we are guessing what the
path is.
>
> Can the batch file be created via the installation script? Then you're
> environment would be cygwin and not windows, wouldn't it? The thing I
> don't know there would be the "cr/lf" vs "lf" thing.
>
>
> >>That's no excuse to fail to fix a known problem.
>
> Bernard,
> And "not having a better solution", is it a good excuse? It's always
> easy to critize but critizing doesn't make the world to go forward.
>
>
> > Huh? There are things in life that are worth spending time on because they
> > will have a large effect, and there are things in life that are not worth
> > spending time on because they will have almost no effect whatsoever. Changing
> > the startxwin.bat file to allow people to run it from a location other than
> > where it is installed to (which has got to be obvious to most users as doing
> > something that was not intended), is one of those things that will have almost
> > no effect. You are going to have to do a lot better than that if you expect
> > me to keep my gleaming white ass in a dimly lit room programming when I could
> > be sitting outside by the pool, getting a tan, and drinking a beer.
> >
> > Man, if you are going to try to one-up the maintainer in public, you had damn
> > well better be giving a complete solution, rather than trying to suggest that
> > the maintainer creates one himself. Because in the latter case you just open
> > yourself up to off-topic ranting like I just did. Yes, this makes me feel
> > better when I get to write funny things about how I don't like to program.
> > So, in a way, you have done me a good service. Thank you :)
>
> Go harold, go!! Kill him :). You know what is better than "sitting
> outside by the pool, getting a tan, and drinking a beer"? It sitting
> outside by the pool, getting a tan, drinking a beer and watching a fight
> game! :)
>
> Jehan

Heh heh... What is a ``fight game''? Are you referring to boxing?

Harold





_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]