⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpan2dist

📁 source of perl for linux application,
💻
📖 第 1 页 / 共 2 页
字号:
                    my $rv = $obj->install(                               prereq_target   => $target,                            target          => $target,                            keep_source     => $keep,                            prereq_build    => $prereqbuild,                            ### any passed arbitrary options                            %$dist_opts,                    );                                        alarm 0;                     $rv;                };                     ### set here again, in case the install dies    alarm 0;    ### install failed due to a 'die' in our prereq skipper?    if( $@ and ref $@ and $@->isa( PREREQ_SKIP_CLASS ) ) {        warn loc("Dist creation of '%1' skipped: '%2'",                     $obj->module, $@->() );        next;    } elsif ( $@ and ref $@ and $@->isa( ALARM_CLASS ) ) {        warn loc("\nDist creation of '%1' skipped, build time exceeded: ".                 "%2 seconds\n", $obj->module, $timeout );        next;                        ### died for some other reason? just report and skip    } elsif ( $@ ) {        warn loc("Dist creation of '%1' failed: '%2'",                    $obj->module, $@ );        next;    }            ### we didn't get a dist object back?    unless ($dist and $obj->status->dist) {        warn loc("Unable to create '%1' dist of '%2'", $format, $obj->module);        next    }    print "Created '$format' distribution for ", $obj->module,                " to:\n\t", $obj->status->dist->status->dist, "\n";}sub parse_file {    my $file    = shift or return;    my $qr      = shift() ? 1 : 0;    my $fh = OPEN_FILE->( $file ) or return;    my @rv;    while( <$fh> ) {        chomp;        next if /^#/;                   # skip comments        next unless /\S/;               # skip empty lines        s/^(\S+).*/$1/;                 # skip extra info        push @rv, $qr ? qr/$_/ : $_;    # add pattern to the list    }       return @rv;}=head1 NAMEcpan2dist - The CPANPLUS distribution creator=head1 DESCRIPTIONThis script will create distributions of C<CPAN> modules of the formatyou specify, including its prerequisites. These packages can then beinstalled using the corresponding package manager for the format.Note, you can also do this interactively from the default shell,C<CPANPLUS::Shell::Default>. See the C<CPANPLUS::Dist> documentation,as well as the documentation of your format of choice for any formatspecific documentation.=head1 USAGE=cutsub usage {    my $me      = basename($0);    my $formats = join "\n", map { "\t\t$_" } sort keys %formats;    my $usage = << '=cut';=pod Usage: cpan2dist [--format FMT] [OPTS] Mod::Name [Mod::Name, ...]        cpan2dist [--format FMT] [OPTS] --modulelist /tmp/mods.list        cpan2dist [--format FMT] [OPTS] --archive /tmp/dist [/tmp/dist2]     Will create a distribution of type FMT of the modules    specified on the command line, and all their prerequisites.        Can also create a distribution of type FMT from a local    archive and all it's prerequisites=cut    $usage .= qq[    Possible formats are:$formats    You can install more formats from CPAN!    \n];        $usage .= << '=cut';=pod    Options:    ### take no argument:    --help          Show this help message    --install       Install this package (and any prerequisites you built)                    after building it.     --skiptest      Skip tests. Can be negated using --noskiptest    --force         Force operation. Can be negated using --noforce    --verbose       Be verbose. Can be negated using --noverbose    --keepsource    Keep sources after building distribution. Can be                    negated by --nokeepsource. May not be supported                     by all formats    --makefile      Prefer Makefile.PL over Build.PL. Can be negated                    using --nomakefile. Defaults to your config setting    --buildprereq   Build packages of any prerequisites, even if they are                    already uptodate on the local system. Can be negated                    using --nobuildprereq. Defaults to false.    --archive       Indicate that all modules listed are actually archives    --flushcache    Update CPANPLUS' cache before commencing any operation    --defaults      Instruct ExtUtils::MakeMaker and Module::Build to use                    default answers during 'perl Makefile.PL' or 'perl                    Build.PL' calls where possible    --edit-metafile Edit the distributions metafile(s) before the distribution                    is built. Requires a configured editor.    ### take argument:    --format      Installer format to use (defaults to config setting)    --ban         Patterns of module names to skip during installation,                  case-insensitive (affects prerequisites too)                  May be given multiple times    --banlist     File containing patterns that could be given to --ban                  Are appended to the ban list built up by --ban                  May be given multiple times.    --ignore      Patterns of modules to exclude from prereq list. Useful                  for when a prereq listed by a CPAN module is resolved                   in another way than from its corresponding CPAN package                  (Match is done on both module name, and package name of                  the package the module is in, case-insensitive)    --ignorelist  File containing patterns that may be given to --ignore.                  Are appended to the ban list built up by --ignore.                  May be given multiple times.    --modulelist  File containing a list of modules that should be built.                  Are appended to the list of command line modules.                  May be given multiple times.    --logfile     File to log all output to. By default, all output goes                  to the console.    --timeout     The allowed time for buliding a distribution before                  aborting. This is useful to terminate any build that                   hang or happen to be interactive despite being told not                   to be. Defaults to 300 seconds. To turn off, you can                   set it to 0.    --set-config  Change any options as specified in your config for this                  invocation only. See CPANPLUS::Config for a list of                   supported options.    --set-program Change any programs as specified in your config for this                  invocation only. See CPANPLUS::Config for a list of                   supported programs.    --dist-opts   Arbitrary options passed along to the chosen installer                  format's prepare()/create() routine. Please see the                  documentation of the installer of your choice for                   options it accepts.    ### builtin lists    --default-banlist    Use our builtin banlist. Works just like --ban                         and --banlist, but with pre-set lists. See the                         "Builtin Lists" section for details.    --default-ignorelist Use our builtin ignorelist. Works just like                          --ignore and --ignorelist but with pre-set lists.                          See the "Builtin Lists" section for details.Examples:    ### build a debian package of DBI and it's prerequisites,     ### don't bother running tests    cpan2dist --format CPANPLUS::Dist::Deb --buildprereq --skiptest DBI        ### build a debian package of DBI and it's prerequisites and install them    cpan2dist --format CPANPLUS::Dist::Deb --buildprereq --install DBI        ### Build a package, whose format is determined by your config, of     ### the local tarball, reloading cpanplus' indices first and using    ### the tarballs Makefile.PL if it has one.    cpan2dist --makefile --flushcache --archive /path/to/Cwd-1.0.tgz        ### build a package from Net::FTP, but dont build any packages or    ### dependencies whose name match 'Foo', 'Bar' or any of the     ### patterns mentioned in /tmp/ban    cpan2dist --ban Foo --ban Bar --banlist /tmp/ban Net::FTP        ### build a package from Net::FTP, but ignore it's listed dependency    ### on IO::Socket, as it's shipped per default with the OS we're on    cpan2dist --ignore IO::Socket Net::FTP        ### building all modules listed, plus their prerequisites    cpan2dist --ignorelist /tmp/modules.ignore --banlist /tmp/modules.ban       --modulelist /tmp/modules.list --buildprereq --flushcache       --makefile --defaults        ### pass arbitrary options to the format's prepare()/create() routine    cpan2dist --dist-opts deb_version=3 --dist-opts prefix=corp=cut        $usage .= qq[Builtin Lists:    Ignore list:] . _default_ignore_list() . qq[    Ban list:] .    _default_ban_list();        ### strip the pod directives    $usage =~ s/=pod\n//g;        return $usage;}=pod=head1 Built-In Filter ListsSome modules you'd rather not package. Some because theyare part of core-perl and you dont want a new package.Some because they won't build on your system. Some becauseyour package manager of choice already packages them for you.There may be a myriad of reasons. You can use the C<--ignore>and C<--ban> options for this, but we provide some built-inlists that catch common cases. You can use these built-in listsif you like, or supply your own if need be.=head2 Built-In Ignore List=pod You can use this list of regexes to ignore modules matchingto be listed as prerequisites of a package. Particulaly usefulif they are bundled with core-perl anyway and they have knownissues building.Toggle it by supplying the C<--default-ignorelist> option.=cutsub _default_ignore_list {    my $list = << '=cut';=pod    ^IO$                    # Provided with core anyway    ^Cwd$                   # Provided with core anyway    ^File::Spec             # Provided with core anyway    ^Config$                # Perl's own config, not shipped separately    ^ExtUtils::MakeMaker$   # Shipped with perl, recent versions                             # have bug 14721 (see rt.cpan.org)    ^ExtUtils::Install$     # Part of of EU::MM, same reason    =cut    return $list;}=head2 Built-In Ban listYou can use this list of regexes to disable building of thesemodules altogether.Toggle it by supplying the C<--default-banlist> option.=cutsub _default_ban_list {    my $list = << '=cut';=pod    ^GD$                # Needs c libaries    ^Berk.*DB           # DB packages require specific options & linking    ^DBD::              # DBD drives require database files/headers    ^XML::              # XML modules usually require expat libraries    Apache              # These usually require apache libraries    SSL                 # These usually require SSL certificates & libs    Image::Magick       # Needs ImageMagick C libraries    Mail::ClamAV        # Needs ClamAV C Libraries    ^Verilog            # Needs Verilog C Libraries    ^Authen::PAM$       # Needs PAM C libraries & Headers=cut    return $list;}__END__=head1 SEE ALSOL<CPANPLUS::Dist>, L<CPANPLUS::Module>, L<CPANPLUS::Shell::Default>,C<cpanp>=head1 BUG REPORTSPlease report bugs or other issues to E<lt>bug-cpanplus@rt.cpan.org<gt>.=head1 AUTHORThis module by Jos Boumans E<lt>kane@cpan.orgE<gt>.=head1 COPYRIGHTThe CPAN++ interface (of which this module is a part of) is copyright (c) 2001 - 2007, Jos Boumans E<lt>kane@cpan.orgE<gt>. All rights reserved.This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.=cut# Local variables:# c-indentation-style: bsd# c-basic-offset: 4# indent-tabs-mode: nil# End:# vim: expandtab shiftwidth=4:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -