Installing cygwin-mketc.sh

Igor Pechtchanski pechtcha@cs.nyu.edu
Sun Sep 15 09:28:00 GMT 2002


On Sun, 15 Sep 2002, Paul Johnston wrote:

> Hi,
>
> How does cygwin install decide where to put files? I was expecting some kind
> of map file mapping object files to installed files, but I couldn't find one.
> I can see we want cygwin-mketc.sh to end up in configure's $sysconfdir but
> beyond that I'm just getting lost
>
> > I've attached the message correction.  If this is really part of cygwin,
> > please take it out altogether, along with the translation of $WINETC.
>
> Ok, I've taken out the message, but NOT the case translation of $WINETC. The
> case translation must be done before the directory existence check, or the
> check might fail. I think this has got to be the final version of the code
> now.
>
> Paul

Paul,
The real reason we need the case translation is for the links is that if
the user doesn't have "check_case:strict" when installing, but later sets
it, the links will still work.

If "check_case:strict" is in effect, the case translation will fail
anyway.  And if it's not in effect, then the directory existence check
will succeed as well.  So the translation is redundant.  But it doesn't
hurt (maybe slows the script down a bit), and in a post-install script
performance is not an issue, so let's leave it in.

However, this reminds me - we had to turn off "check_case:strict" for the
duration of the script for it to work at all with non-standard file and
directory cases!  Something like

  CYGWIN="$CYGWIN check_case:relaxed"; export CYGWIN

I meant to do this one, but completely forgot.  New version attached.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Water molecules expand as they grow warmer" (C) Popular Science, Oct'02, p.51

-------------- next part --------------
#!/bin/sh
#--
# Create symbolic links from some /etc files to the Windows equivalents
#--

FILES="hosts protocols services networks"

OSNAME="`/bin/uname -s`"
WINHOME="`/bin/cygpath -W`"

CYGWIN="$CYGWIN check_case:relaxed"
export CYGWIN

case "$OSNAME" in
  CYGWIN_NT*) WINETC="$WINHOME/system32/drivers/etc" ;;
  CYGWIN_9*|CYGWIN_ME*) WINETC="$WINHOME" ;;
  *) 
    echo "Unknown system type $OSNAME; exiting" >&2
    exit 0
  ;;
esac

WINETC="$(/bin/cygpath -u "$(/bin/cygpath -w -l "$WINETC")")"
if [ ! -d "$WINETC" ]
then
  echo "Directory $WINETC does not exist; exiting" >&2
  exit 0
fi

for FILE in $FILES
do
  if [ ! -e "/etc/$FILE" -a ! -L "/etc/$FILE" ]
  then
    # Windows only uses the first 8 characters
    WFILE="$WINETC/`expr substr "$FILE" 1 8`"
    WFILE="$(/bin/cygpath -u "$(/bin/cygpath -w -l "$WFILE")")"
    /bin/ln -s -v "$WFILE" "/etc/$FILE"
  fi
done



-------------- next part --------------
--- cygwin-mketc.sh-0.10.1	2002-09-15 05:21:30.000000000 -0400
+++ cygwin-mketc.sh	2002-09-15 12:07:05.000000000 -0400
@@ -8,6 +8,9 @@ FILES="hosts protocols services networks
 OSNAME="`/bin/uname -s`"
 WINHOME="`/bin/cygpath -W`"
 
+CYGWIN="$CYGWIN check_case:relaxed"
+export CYGWIN
+
 case "$OSNAME" in
   CYGWIN_NT*) WINETC="$WINHOME/system32/drivers/etc" ;;
   CYGWIN_9*|CYGWIN_ME*) WINETC="$WINHOME" ;;
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list