summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/bin/parinstallppd
blob: ea4c6385a66dc9bad7a7dd0ad61730a5b4910b9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/perl
use strict;
use warnings;

use Getopt::Long qw/GetOptions/;
use PAR::Dist::InstallPPD;

our $VERSION = '0.02';

=pod

=head1 NAME

parinstallppd - Install PPD/PPM packages using PAR

=head1 SYNOPSIS

parinstallppd --help

parinstallppd [-v ...] -u PPD-URI-OR-FILE

=head1 DESCRIPTION

This script converts packages for the I<Perl Package Manager>
which is specific to ActiveState's perl distributions to F<.par>
files and installs those using L<PAR::Dist>.

It works much the same way as the L<ppd2par> tool but with an additional
installation step after the conversion.

=head2 Parameters

  -u --uri
    Set the place to fetch the .ppd file from. Can be an URL
    (http://..., https://..., ftp://...) or a local file.
  -v --verbose
    Sets the verbose mode.

  --sa --selectarch
    Regexp for selecting the implementation based on architecture.
    Defaults to the currently running architecture.
  --sp --selectperl
    Regexp for selecting the implementation based on perl version.
    Defaults to the currently running perl version (e.g. 5.8.8) and falls
    back to the main version (e.g. 5.8) and then other sub-versions
    (e.g. 5.8.7)

=head1 SEE ALSO

This tool is implemented using the L<PAR::Dist::InstallPPD> module. Please
refer to that module's documentation for details on how this all works.

PAR has a mailing list, <par@perl.org>, that you can write to; send
an empty mail to <par-subscribe@perl.org> to join the list and
participate in the discussion.

Please send bug reports to <bug-par-dist-fromcpan@rt.cpan.org>.

The official PAR website may be of help, too: http://par.perl.org

For details on the I<Perl Package Manager>, please refer to ActiveState's
website at L<http://activestate.com>.

=head1 AUTHOR

Steffen Mueller, E<lt>smueller at cpan dot orgE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2006 by Steffen Mueller

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.6 or,
at your option, any later version of Perl 5 you may have available.

=cut

my $usage = <<"HERE";
$0 --help          # for help

$0 [-v --no-docs] -u PPD-URI-OR-FILE

This script converts packages for the I<Perl Package Manager>
which is specific to ActiveState's perl distributions to F<.par>
files and installs those using L<PAR::Dist>.

It works much the same way as the L<ppd2par> tool but with an additional
installation step after the conversion.

-u --uri
  Set the place to fetch the .ppd file from. Can be an URL
  (http://..., https://..., ftp://...) or a local file.
-v --verbose
  Sets the verbose mode.

--sa --selectarch
  Regexp for selecting the implementation based on architecture.
  Defaults to the currently running architecture.
--sp --selectperl
  Regexp for selecting the implementation based on perl version.
  Defaults to the currently running perl version (e.g. 5.8.8) and
  falls   back to the main version (e.g. 5.8) and then other
  sub-versions (e.g. 5.8.7)
HERE

my $uri;
my $v = 0;
my $sperl;
my $sarch;
GetOptions(
    'sa|selectarch=s' => \$sarch,
    'sp|selectperl=s' => \$sperl,
	'h|help' => sub { print $usage; exit(1) },
	'u|uri=s' => \$uri,
	'v|verbose' => \$v,
);

par_install_ppd(
	uri => $uri,
	($v               ? (verbose      => 1            ) : ()),
    ($sarch           ? (selectarch   => $sarch       ) : ()),
    ($sperl           ? (selectperl   => $sperl       ) : ()),
);