in reply to make dist (ExtUtils::MakeMaker) on Windows stores text files with DOS line endings in .tar.gz archive

I'm asking here: does this matter?

I don't think it matters. As I understand it, PAUSE just accepts the tar.gz as is. It's up to the tar utility of the user who downloads the tar.gz to handle the text files appropriately when unpacking the archive.

Cheers,
Rob
  • Comment on Re: make dist (ExtUtils::MakeMaker) on Windows stores text files with DOS line endings in .tar.gz archive

Replies are listed 'Best First'.
Re^2: make dist (ExtUtils::MakeMaker) on Windows stores text files with DOS line endings in .tar.gz archive
by randyk (Parson) on Nov 20, 2006 at 06:30 UTC
    I think that's right that PAUSE doesn't care, and also, it's up to the user's system to handle the line endings appropriately. However, there may be some circumstances where unix-style line endings are expected in a distribution - for example, some time ago search.cpan.org had to patch some tools that generate the html docs if Windows-style line endings were present, and there was a recent bug in ExtUtils-Manifest also related to such line endings. It's probably best, if possible, to run make dist to create a CPAN distribution on a Unix machine.

      Running make dist on a Unix machine doesn't help anything if the text files have Windows-style (or Mac-style) line endings. The only thing that would help would be to convert all files to Unix-line endings before running make dist, which can be done on a Windows or Unix machine.

      I use a test file by brian_d_foy that checks the line endings of all files in my distribution to ensure that all are consistent.

Re^2: make dist (ExtUtils::MakeMaker) on Windows stores text files with DOS line endings in .tar.gz archive
by bart (Canon) on Nov 20, 2006 at 11:25 UTC
    It's up to the tar utility of the user who downloads the tar.gz to handle the text files appropriately when unpacking the archive.
    That sounds weird. I had half and half expected that the tar utility would handle it, when creating the .tar(.gz) file. But apparently, it doesn't, as the CRs are present in the archive.

    But, it still feels like a more reasonable expectation to me, because you (and your make) knows what platform you're on when building the archive, so converting it to a common format is easy. The client has less info, he doesn't actually know what platform it originates from, so converting it from whatever into his own native format involves more guesswork.

      I had half and half expected that the tar utility would do it, when creating the .tar(.gz) file

      I'm thinking that when the tar utility creates the archive it should do nothing other than pack the files it has been given ... and that gzip should do nothing other than gzip the archive. (Why should the tar utility convert to nix endings when, for all it knows, the tarball is never going to be unpacked onto a nix machine anyway ?)The clever bit needs to happen when the archive is unpacked - at which point the tar utility looks at the line endings and adjusts them as needed (iff needed).

      Personally, on Win32, I make sure that the tar utility leaves the line endings as they are - that way I don't have to worry about the tar utility amending files that it shouldn't. (I have been bitten by this.) Worst case scenario (for me) is that I then have to view the text files in Wordpad (rather than Notepad) to have them dispayed in a sane fashion.

      Cheers,
      Rob
Re^2: make dist (ExtUtils::MakeMaker) on Windows stores text files with DOS line endings in .tar.gz archive
by Argel (Prior) on Nov 21, 2006 at 18:30 UTC
    Tar is a backup and archival utility (name comes from "Tape Archive") and as such should not be making any modicifcations to the file while adding it to the archive or while extracting it. Modifying the files goes directly against the intended use for the command. There are other tools for doing text file conversion such as dos2unix and unix2dos. Update: Fixed typos