Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Exclude files and directories in tarfile for CPAN upload

by LanX (Saint)
on Oct 24, 2024 at 22:28 UTC ( [id://11162397]=perlquestion: print w/replies, xml ) Need Help??

LanX has asked for the wisdom of the Perl Monks concerning the following question:

Hi

the title says it already, I have a project directory for a distribution which I want to tar.gz for CPAN.

But it contains backup files, a massive .git dir and a dir with dev stuff (experimental code, etc)

What's the easiest way to filter them out? Kind of similar to .gitignore?

...

Well while typing this post I found those promising exclude options and will test them out.

Posting this anyway as an info for the archives ... ¹

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

¹) no pun intended :)

  • Comment on Exclude files and directories in tarfile for CPAN upload

Replies are listed 'Best First'.
Re: Exclude files and directories in tarfile for CPAN upload
by SankoR (Prior) on Oct 24, 2024 at 23:22 UTC
    Are you hand rolling dists? The classics (ExtUtils::MakeMaker, Module::Build, Dist::Zilla, and Minilla) all support MANIFEST.SKIP.
        So do you used Module::Starter ?

        The short documentation of the module says:

        The ignores_type is a new feature that allows one to create SCM-specif +ic ignore files. These are the mappings: ignores_type => 'generic' # default, creates 'ignore.txt' ignores_type => 'cvs' # creates .cvsignore ignores_type => 'git' # creates .gitignore ignores_type => 'hg' # creates .hgignore ignores_type => 'manifest' # creates MANIFEST.SKIP

        Go canonical and use my guide ;)

        L*

        PS the above module ships with the module-starter program inside /bin and this is the suggested method to follow. The program has the option --ignores=type the sets the above mentioned ignores_type internal option. It defaults to txt creating ignore.txt

        There are no rules, there are no thumbs..
        Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
        Confusingly did Module::Starter create a README, but PAUSE says not to upload one...

        The PAUSE document is advising you not to upload a separate README file individually outside of the distribution tarball. That's a totally different thing from including a README inside the tarball which you absolutely should do.


        🦛

Re: Exclude files and directories in tarfile for CPAN upload
by Discipulus (Canon) on Oct 25, 2024 at 06:55 UTC
    Hello,

    I'm with SankoR and, for the archives, you can read about MANIFEST.SKIP in What are the files in a CPAN distribution? too.

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re: Exclude files and directories in tarfile for CPAN upload
by stevieb (Canon) on Oct 25, 2024 at 07:55 UTC

    I'm with my previously posting Monks... MANIFEST.SKIP.

    When first writing for the CPAN, it's easy to manually ensure. When you're to the point of maintaining multiple distributions, it's equally easy to automate.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11162397]
Approved by SankoR
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2025-11-15 21:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (72 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.