[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: where should patches be sent?

> -----Original Message-----
> From: Wichert Akkerman [mailto:wichert@wiggy.net] 
> Sent: Thursday, 18 July 2002 7:47 PM
> To: Robert Collins

> > In the future there will also be a file mode set of 
> patches, to force
> > binary or text mode reading and writing on appropriate 
> files. That's not
> > even started yet.
> Is that really needed?

Unfortunately yes.

MSDOS, and thus windows have CRLF pairs in text files, which confuses
the heck out of vanilla unix utilities that treat text data as a binary
file with LF delimiters.

To address that cygwin has an file mode 'text' (use t in the fopen mode
string) where CRLF are translated to LF on the fly, with the result that
binary files opened in that mode die badly (i.e. databases, tarballs,

That isn't so bad I hear you thinking - dpkg will write and read
consistently and end up with the same data. 

Well here is the clincher. When a windows directory is mounted for
cygwin to access, a default mode is applied - either bin or text - and
all non-specific opens on resources on that directory tree use that
mode. The current port will thus only be reliable for users using
binmode mounted filesystems, and furthermore will break if someone edits
a file - say /var/lib/dpkg/available with a windows text editor.

On the bright side, the changes needed are quite small, at worst a
single setmode call for each fopen|open call. Often less than that is
needed because O_TEXT and O_BINARY can be passed to open(), and 't' to
fopen() leaving only binary fopen()'d files needing a setmode call. And
fopening a binary file is relatively rare :}.


To UNSUBSCRIBE, email to debian-dpkg-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: