]> git.vpit.fr Git - perl/modules/Task-Devel-Cover-Recommended.git/commitdiff
The -n switch prevents samples/generate.pl from bumping the version
authorVincent Pit <vince@profvince.com>
Mon, 20 Aug 2012 10:10:15 +0000 (12:10 +0200)
committerVincent Pit <vince@profvince.com>
Mon, 20 Aug 2012 10:55:50 +0000 (12:55 +0200)
samples/generate.pl

index 13d8db9eb6767e71ac3689ca9756ac03a3df06e1..f1af4a86be7d48990f09407c1ac45ff7eb25fb5f 100644 (file)
@@ -11,6 +11,7 @@ use Cwd;
 use File::Fetch;
 use File::Spec;
 use File::Temp 0.19;
+use Getopt::Std;
 use List::Util;
 use Parse::CPAN::Meta;
 
@@ -30,6 +31,9 @@ my %prereq_desc = (
  '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;
 
@@ -148,8 +152,10 @@ my ($old_task_revision) = $old_task_version =~ /([0-9]+)$/;
 
 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;