This is the mail archive of the cygwin@sourceware.cygnus.com 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]

Re: How does setup.exe handle duplicate files?


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.Tishler@dothill.com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


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