App-Cpanx

 view release on metacpan or  search on metacpan

bin/cpanx  view on Meta::CPAN

            for my $obj2 (@{$obj->{children}}) {
                clean_yaml($obj2);
                push @{$obj->{value}}, $obj2->{value};
            }
        }
        elsif ($obj2->{type} eq "keyval") {
            $obj->{value} = {};
            for my $obj2 (@{$obj->{children}}) {
                clean_yaml($obj2);
                $obj->{value}{$obj2->{key}} = $obj2->{value};
            }
        }
    }
}

sub runcmd {
    my ($cmd, $show_cmd, $quiet) = @_;
    $show_cmd ||= $cmd;
    if ($quiet) {
        system $cmd;
    }
    else {
        print "$show_cmd\n";
        system $cmd;
        print "\n";
    }
}

sub add_configure_opt {
    my ($opt, $path) = @_;
    if (!defined $path) {
        die "Invalid -$opt argument\n";
    }
    if ($opt eq "I") {
        $mm_opt .= " INSTALL_BASE=\"$path\"";
        $mb_opt .= " --install_base \"$path\"";
    }
    elsif ($opt eq "L") {
        my $arch = $Config{archname};
        $mm_opt .= " INSTALLPRIVLIB=\"$path\" INSTALLSITELIB=\"$path\"";
        $mm_opt .= " INSTALLARCHLIB=\"$path/$arch\" INSTALLSITEARCH=\"$path/$arch\"";
        $mb_opt .= " --install_path lib=\"$path\"";
        $mb_opt .= " --install_path arch=\"$path/$arch\"";
    }
    elsif ($opt eq "LL") {
        $mm_opt .= " INSTALLPRIVLIB=\"$path\" INSTALLSITELIB=\"$path\"";
        $mm_opt .= " INSTALLARCHLIB=\"$path\" INSTALLSITEARCH=\"$path\"";
        $mb_opt .= " --install_path lib=\"$path\"";
        $mb_opt .= " --install_path arch=\"$path\"";
    }
    elsif ($opt eq "B") {
        $mm_opt .= " INSTALLBIN=\"$path\" INSTALLSITEBIN=\"$path\"";
        $mb_opt .= " --install_path bin=\"$path\"";
    }
    elsif ($opt eq "SC") {
        $mm_opt .= " INSTALLSCRIPT=\"$path\" INSTALLSITESCRIPT=\"$path\"";
        $mb_opt .= " --install_path script=\"$path\"";
    }
    elsif ($opt eq "M1") {
        $mm_opt .= " INSTALLMAN1DIR=\"$path\" INSTALLSITEMAN1DIR=\"$path\"";
        $mb_opt .= " --install_path bindoc=\"$path\"";
    }
    elsif ($opt eq "M3") {
        $mm_opt .= " INSTALLMAN3DIR=\"$path\" INSTALLSITEMAN3DIR=\"$path\"";
        $mb_opt .= " --install_path libdoc=\"$path\"";
    }
}

sub get_opts {
    my @args;
    while (my $arg = shift @ARGV) {
        if ($arg =~ /^--?$/) {
            push @args, @ARGV;
            last;
        }
        elsif ($arg =~ /^(--?help|-h)$/) {
            usage();
        }
        elsif ($arg eq "-g") {
            $opts{action} = "list_modules";
        }
        elsif ($arg eq "-G") {
            $opts{action} = "list_packages";
        }
        elsif ($arg eq "-m") {
            $opts{cpan} = shift(@ARGV);
        }
        elsif ($arg eq "-M") {
            $opts{action} = "mirror";
        }
        elsif ($arg eq "-l") {
            $opts{action} = "look";
        }
        elsif ($arg eq "-p") {
            $opts{action} = "perldoc";
        }
        elsif ($arg eq "-i") {
            $opts{action} = "info";
        }
        elsif ($arg eq "-f") {
            $opts{action} = "display_installation_files";
        }
        elsif ($arg eq "-c") {
            $opts{action} = "clean";
        }
        elsif ($arg =~ /^-[vV]$/) {
            $opts{action} = "version";
            if ($arg eq "-V") {
                $opts{with_counts} = 1;
            }
        }
        elsif ($arg eq "-u") {
            $opts{action} = "uninstall";
        }
        elsif ($arg eq "-d") {
            $opts{dependencies_only} = 1;
        }
        elsif ($arg eq "-n") {
            $opts{interactive} = 0;
        }
        elsif ($arg eq "-S") {



( run in 0.811 second using v1.01-cache-2.11-cpan-2398b32b56e )