bart has asked for the wisdom of the Perl Monks concerning the following question:
doesn't convert the text files to Unix format before creating the .tar.gz archive file. I'm asking here: does this matter?make dist
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: make dist (ExtUtils::MakeMaker) on Windows stores text files with DOS line endings in .tar.gz archive
by syphilis (Archbishop) on Nov 20, 2006 at 00:09 UTC | |
by randyk (Parson) on Nov 20, 2006 at 06:30 UTC | |
by Corion (Patriarch) on Nov 20, 2006 at 07:57 UTC | |
by bart (Canon) on Nov 20, 2006 at 11:25 UTC | |
by syphilis (Archbishop) on Nov 20, 2006 at 11:59 UTC | |
by Argel (Prior) on Nov 21, 2006 at 18:30 UTC |