This is the mail archive of the cygwin mailing list for the Cygwin 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: How does a script find where Cygwin is installed?

On Fri, 3 Sep 2004, luke.kendall wrote:

> $ CYGPATH=`cygpath -w /`
> $ echo $CYGPATH
> C:\cygwin
> $ CYGPATH=`cygpath -u "$CYGPATH"`
> $ echo $CYGPATH
> /
> What I really want to get is "C:/cygwin"

$ cygpath -m /

> or "/cygdrive/c/cygwin", in my case.

$ cygpath -m / | sed 's,^\([A-Za-z]\):,/cygdrive/\1,'

> Look at the weird messages I get from this chmod:
> $ chmod -R ug+rwX,o+rX /
> chmod: getting attributes of `//bin: No such file or directory
> [snip similar messages]

This is a bug in chmod -R that manifests in Cygwin.  The real solution is
to fix chmod, in lines 236-241 of chmod.c in fileutils-4.1-2.  A
workaround would be

$ cd / && chmod -R ug+rwX,o+rX .

(or, a bit simpler, "cd / && chmod -R a+rX,ug+w .")...

> (I'm doing this to try to ensure that if a SysAdmin user installs
> Cygwin for the actual owner of the machine, the owner will later have
> permission to update or even uninstall Cygwin themselves.)

      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing."  -- Dr. Jubal Harshaw

Unsubscribe info:
Problem reports:

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