use File::Fetch;
use File::Spec;
use File::Temp 0.19;
+use Getopt::Std;
use List::Util;
use Parse::CPAN::Meta;
'PPI::HTML' => 'Devel::Cover lets you optionally pick between L<PPI::HTML> and L<Perl::Tidy>, but it will only use the former if both are installed.',
);
+my %opts;
+getopts 'n' => \%opts;
+
sub get_latest_dist {
my $dist = shift;
my $new_task_version = version->parse($target_version)->normal;
my $new_task_revision = $old_task_revision;
-++$new_task_revision
- if version->parse($new_task_version) <= version->parse($old_task_version);
+if (!$opts{n}
+ and version->parse($new_task_version) <= version->parse($old_task_version)) {
+ ++$new_task_revision;
+}
if (($target_version =~ tr/.//) < 2) {
my @components = split /\./, $new_task_version;
$components[2] = $new_task_revision;
map { $_ => $hr->{$_} } sort keys %$hr;
}
+# Make sure no package FOO statement appears in this file.
+my $package_statement = join ' ', 'package',
+ $task_pkg;
+
my %vars = (
TARGET_PKG => $target_pkg,
TARGET_VERSION => $target_version,
TASK_PKG => $task_pkg,
+ PACKAGE_TASK_PKG => $package_statement,
TASK_VERSION => $new_task_version,
PERL_PREREQ => $prereqs{perl},
CONFIGURE_PREREQS_POD => deplist_to_pod(sorthr $prereqs{configure}),
my %templates = (
$task_file => <<'TEMPLATE',
-package __TASK_PKG__;
+__PACKAGE_TASK_PKG__;
use strict;
use warnings;