| 1 | #!/usr/local/bin/perl -w | ||
| 2 | use strict; | ||
| 3 | use PAR::WebStart::Util qw(make_par); | ||
| 4 | use Getopt::Long; | ||
| 5 | |||
| 6 | my ($name, $help, $no_sign, $src_dir, $dst_dir); | ||
| 7 | my $rc = GetOptions('help' => \$help, | ||
| 8 | 'name=s' => \$name, | ||
| 9 | 'no-sign' => \$no_sign, | ||
| 10 | 'src_dir=s' => \$src_dir, | ||
| 11 | 'dst_dir=s' => \$dst_dir); | ||
| 12 | |||
| 13 | if ($help or not $rc) { | ||
| 14 | print <<"USE"; | ||
| 15 | |||
| 16 | Make a par archive for use with PAR::WebStart | ||
| 17 | |||
| 18 | Usage: my (\$par, \$md5) = make_par [ options ] | ||
| 19 | |||
| 20 | Available options: | ||
| 21 | |||
| 22 | --help: display this message | ||
| 23 | --no-sign: do not sign the par file | ||
| 24 | --name=MyPar: specify the name of the par file | ||
| 25 | --src_dir=/Some/src: specify the source directory | ||
| 26 | --dst_dir=/Some/dst: specify the destination directory | ||
| 27 | |||
| 28 | If successful, returns the name of the par and md5 checksum files. | ||
| 29 | |||
| 30 | USE | ||
| 31 | exit(1); | ||
| 32 | } | ||
| 33 | |||
| 34 | my ($par, $md5) = make_par(name => $name, src_dir => $src_dir, | ||
| 35 | dst_dir => $dst_dir, no_sign => $no_sign); | ||
| 36 | print <<"END"; | ||
| 37 | |||
| 38 | The par file was successfully created as | ||
| 39 | $par, | ||
| 40 | with an associated md5 checksum file | ||
| 41 | $md5. | ||
| 42 | |||
| 43 | END | ||
| 44 | |||
| 45 | __END__ |