Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Cleaning out .cpan/build directory

by John M. Dlugosz (Monsignor)
on May 24, 2011 at 22:10 UTC ( #906580=perlquestion: print w/ replies, xml ) Need Help??
John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:

Is there a proper way to clean out the files the cpan utility left behind? I see tons of stuff in ~/.cpan/build, and I would have supposed these to be temp files.

Before I just delete stuff, I want to know if it's OK or what. I didn't see any clean-up option for cpan in perldocs, and supersearch for ".cpan/build directory clean" and variations didn't turn up anything.

Thanks.

óJohn

Comment on Cleaning out .cpan/build directory
Select or Download Code
Re: Cleaning out .cpan/build directory
by ikegami (Pope) on May 24, 2011 at 22:58 UTC
    You can freely delete what's there. The size of it is limited by o conf build_cache (in MB).
Re: Cleaning out .cpan/build directory
by CountZero (Bishop) on May 25, 2011 at 06:00 UTC
    Cleaning out this directory will not break your Perl-system, but I do check its contents (before the automatic cleaning happens) to see if there are any interesting files in it. Some modules install additional examples and such here. Also looking at some of the tests for the module just installed can give you some extra understanding of its inner working.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re: Cleaning out .cpan/build directory
by Tux (Monsignor) on May 25, 2011 at 06:37 UTC

    If you want to clean the stuff that does not influence cpan (the command), you can clean out even more:

    $ cat bin/cpan-clean #!/bin/sh rm -rf $HOME/.cpan/build/* \ $HOME/.cpan/sources/authors/id \ $HOME/.cpan/cpan_sqlite_log.* \ /tmp/cpan_install_*.txt

    Enjoy, Have FUN! H.Merijn
      seems like cpan should know to clean build directory ... or use temp for that
        Actually cpan knows how to do that.

        It has a clean command and will clean the .build folder when it gets too big.

        Using the temp area is not such a swell idea since you might want to inspect the files in the .build folder and the temp area has the habit of getting emptied at inopportune moments. At least on Windoze. :(

        CountZero

        A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      IIRC, sources (second item) aren't kept if you unset keep_source_where.

      You might also want to remove FTPstats.yml.

      Provided that you don't have a hateful .cpan/MyConfig, then you can blow the whole of .cpan away. That's the first thing I do when any of my boxes start running low on disk space.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (12)
As of 2014-09-19 12:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (137 votes), past polls