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: cygwin/xfree86/emacs problems after upgrading


On Thu, 26 Feb 2004, Takuma Murakami wrote:

> Igor,
>
> > Yes, it's a neat trick *if* the only thing people changed was the install
> > drive.  If they change the path, all bets are off.  I'm surprised you
> > don't actually customize startxwin.bat (and similar files, like
> > startxdmcp.bat) in a postinstall script (which can run under a Cygwin
> > shell, and thus know the root of the install).  You could choose a
> > template value, e.g. "%$CYGWIN_ROOT$%", and replace that with "`cygpath -w
> > /`" using, say, sed.  If you're interested, I could whip up an example
> > postinstall script for you in the next week or so.
>
> I'm interested in that trick out of curiosity.
> Could you show me your boilerplate?
>
> Takuma Murakami

Well, something like the script below (untested) should do...  This uses
'%$CYGWIN_ROOT$%' as the template string.
HTH,
	Igor

-------------- BEGIN /etc/postinstall/fix-startxwin.sh --------------
#!/bin/sh

fix_cygwin_root() {
  TMPNAME="$1.$$" && \
  mv "$1" "$TMPNAME" && \
  sed 's/%\$CYGWIN_ROOT\$%/"'"`cygpath -w /`"'"/' "$TMPNAME" > "$1" && \
  rm "$TMPNAME"
}

cd /usr/X11R6/bin && \
for i in startxwin.bat startxdmcp.bat; do \
  fix_cygwin_root "$i" \
done
--------- Note: cutting here may damage your screen surface ---------

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton


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