App-DistUtils

 view release on metacpan or  search on metacpan

script/list-dist-contents  view on Meta::CPAN

    },
};
sub list_dist_contents {
    require Dist::Util;

    my %args = @_;

    my $dist = $args{dist};
    $dist =~ s/-/::/g;
    my $packlist = Dist::Util::packlist_for($dist);
    return [404, "Can't find .packlist for $dist"] unless $packlist;
    [200, "OK", do { local $/; open my($fh), "<", $packlist; ~~<$fh> }];
}

Perinci::CmdLine::Any->new(
    url => "/main/list_dist_contents",
)->run;

# ABSTRACT: List contents of an installed Perl distribution
# PODNAME: list-dist-contents

script/packlist-for  view on Meta::CPAN

    my $envres = envresmulti([200,"OK",\@res]);
    for my $mod (@$mods) {
        $mod =~ s!(-|/)!::!g;
        my $packlist = Dist::Util::packlist_for($mod);
        if (defined $packlist) {
            $envres->add_result(200, "OK", {item_id=>$mod});
            push @res, @$mods > 1 ?
                {module=>$mod, packlist=>$packlist} :
                    $packlist;
        } else {
            $envres->add_result(404, "Not found", {item_id=>$mod});
        }
    }
    $envres->as_struct;
}

Perinci::CmdLine::Any->new(
    url => "/main/packlist_for",
)->run;

# ABSTRACT: Locate .packlist for a Perl module

script/uninstall-dist  view on Meta::CPAN


    my %args = @_;

    my $res = envresmulti();
    my $dists = $args{dist};

    for my $dist0 (@$dists) {
        (my $dist = $dist0) =~ s/-/::/g;
        my $packlist = Dist::Util::packlist_for($dist);
        unless ($packlist) {
            $res->add_result(404, "Can't find .packlist for $dist0",
                             {item_id=>$dist0});
            next;
        }

        # the easy way
        my $mod = $dist;

        # the proper way
        #@lines = do { open my($fh), "<", $packlist; map {chomp} <$fh> };
        ## find the first module for module name to feed to cpanm



( run in 0.678 second using v1.01-cache-2.11-cpan-39bf76dae61 )