Alien-Build-Plugin-Fetch-Cache

 view release on metacpan or  search on metacpan

bin/abcache  view on Meta::CPAN

# PODNAME: abcache
our $VERSION = '0.05'; # VERSION


my $opt_list;
my $opt_clear;

GetOptions(
  'list'      => \$opt_list,
  'clear'     => \$opt_clear,
  'version|v' => sub { say "abcache (Alien::Build::Plugin::Fetch::Cache) version @{[ $main::VERSION // 'dev' ]}" },
  'help|h'    => sub { pod2usage( -exitval => 0 ) },
) || pod2usage( -exitval => 2 );

my $root = path(bsd_glob '~/.alienbuild/plugin_fetch_cache');

sub recurse
{
  my $cb = shift;
  my $dir = shift // $root;
  my $list = shift // [];

bin/abcache  view on Meta::CPAN

      $size = do { use bytes; length $meta->{content} };
      $age  = -A $metafile;
    }

    printf "%5s %5s %s\n", format_bytes($size), int($age), $uri;
  });
}
elsif($opt_clear)
{
  my $rm = sub {
    say "RM    $_[0]";
    unlink $_[0];
  };
  my $rmdir = sub {
    say "RMDIR $_[0]";
    rmdir $_[0];
  };
  recurse(sub {
    my($uri, $meta, $metafile) = @_;

    my $dir = $metafile->parent;

    if($meta->{path})
    {
      $rm->($meta->{path});



( run in 0.685 second using v1.01-cache-2.11-cpan-483215c6ad5 )