When preparing an upload to CPAN, I noticed that
make dist
doesn't convert the text files to Unix format before creating the .tar.gz archive file. I'm asking here: does this matter?

Perl used to care about line endings in the source files, not even so long ago (= I'm sure there are still perl versions in use to which line endings matter). It no longer does, except at the end of a shebang line in a script, perhaps.

Still, I don't think it's how it's supposed to be, for archives on CPAN.

Hunting around in the guts of ExtUtils::MakeMaker, I read:

make tardist
First does a distdir. Then a command $(PREOP) which defaults to a null command, followed by $(TOUNIX), which defaults to a null command under UNIX, and will convert files in distribution directory to UNIX format otherwise. Next it runs tar on that directory into a tarfile and deletes the directory. Finishes with a command $(POSTOP) which defaults to a null command.
make dist
Defaults to $(DIST_DEFAULT) which in turn defaults to tardist.

n.b. Do note the typo: the docs say $(TOUNIX), while actually it should be $(TO_UNIX). I reported that documentation bug earlier today.

Apart from OS/2, none of the platforms seem to define a setting for $(TO_UNIX), and OS/2 does it in a most bizarre way (you have to "view source to see this):

sub init_dist { my($self) = @_; $self->{TO_UNIX} ||= <<'MAKE_TEXT'; $(NOECHO) $(TEST_F) tmp.zip && $(RM_F) tmp.zip; $(ZIP) -ll -mr tmp.zip + $(DISTVNAME) && unzip -o tmp.zip && $(RM_F) tmp.zip MAKE_TEXT $self->SUPER::init_dist; }

Yowza: it seems to be using the ZIP command line tool, to decide which files are textfiles, and convert the line endings for those!

My questions: Are the tarred up archived indeed Windows text files? Or does "something" magically convert the files to Unix? For example, PAUSE seems to be doing some additional processing before adding the archive to CPAN. Does it take care of these line endings too? If they are, and it doesn't: does it matter? If it matters, how do we patch it? I feel no inclination to copy the code used for OS/2.

Thank you in advance for any suggestions.


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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.