Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <3941191E.F3A9432F@dothill.com>
Date: Fri, 09 Jun 2000 12:19:42 -0400
From: Jason Tishler <Jason DOT Tishler AT dothill DOT com>
Organization: Dot Hill Systems Corporation
X-Mailer: Mozilla 4.72 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: How does setup.exe handle duplicate files?
References: <3941086F DOT 9AE1D33A AT dothill DOT com> <200006091540 DOT LAA00812 AT envy DOT delorie DOT com> <20000609114851 DOT A22793 AT cygnus DOT com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Chris Faylor wrote:
> On Fri, Jun 09, 2000 at 11:40:59AM -0400, DJ Delorie wrote:
> >> Does setup.exe handle duplicate files correctly?  To be explicit, if
> >> more than one tar.gz archive contain a file with the same name, does
> >> setup.exe install the correct one?
> >
> >No, it just randomly picks one.  As of setup 1.48, though, it should
> >install all files writable so that this problem is avoided.
> 
> Actually previous versions of setup install files as writable, also.

Unfortunately, I'm still concerned that setup may not install the
correct file because the extraction is dependent on the order in
which tar.gz files are found.  From setup.c, we have:

    recurse_dirs (...)
    {
        ...
        pattern = pathcat (dir, "*.gz");
        handle = FindFirstFile (pattern, &find_data);
        ...
        do
        {
            ...
            if (!tarx (dir, find_data.cFileName))
            ...
        while (FindNextFile (handle, &find_data));
        ...
    }

If I understand the above code, then in the case of a duplicate file,
foo, the foo that is extracted last will be the one that is installed.
Hence, "correctness" is solely determined by the enumeration order of
FindFirstFile()/FindNextFile().  I don't see how this policy guarantees
that the correct instance of a duplicate file is always installed.

Jason

-- 
Jason Tishler
Director, Software Engineering       Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corporation         Fax:   +1 (732) 264-8798
82 Bethany Road, Suite 7             Email: Jason DOT Tishler AT dothill DOT com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com