delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/09/15/05:21:34

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3D8452A8.FA2C2251@pajhome.org.uk>
Date: Sun, 15 Sep 2002 10:28:08 +0100
From: Paul Johnston <paj AT pajhome DOT org DOT uk>
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Installing cygwin-mketc.sh
References: <Pine DOT GSO DOT 4 DOT 44 DOT 0209130954300 DOT 19696-300000 AT slinky DOT cs DOT nyu DOT edu>

--------------22CC9131E9CD87A9D8C9C956
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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

--------------22CC9131E9CD87A9D8C9C956
Content-Type: application/x-sh;
 name="cygwin-mketc.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="cygwin-mketc.sh"

#!/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`"

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




--------------22CC9131E9CD87A9D8C9C956
Content-Type: text/plain; charset=us-ascii

--
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/
--------------22CC9131E9CD87A9D8C9C956--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019