Author: stevehay Date: Fri Jul 21 21:32:34 2023 New Revision: 1911180 URL: http://svn.apache.org/viewvc?rev=1911180&view=rev Log: Handle $VERSION more or less as per Apache::Reload to avoid ExtUtils::MakeMaker complaints that -dev and -rcN $VERSIONs are invalid
Modified: perl/Apache-SizeLimit/trunk/Makefile.PL perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit/Core.pm perl/Apache-SizeLimit/trunk/lib/Apache2/SizeLimit.pm Modified: perl/Apache-SizeLimit/trunk/Makefile.PL URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/Makefile.PL?rev=1911180&r1=1911179&r2=1911180&view=diff ============================================================================== --- perl/Apache-SizeLimit/trunk/Makefile.PL (original) +++ perl/Apache-SizeLimit/trunk/Makefile.PL Fri Jul 21 21:32:34 2023 @@ -34,7 +34,11 @@ unless ( $ARGV[0] eq '--dist' || $ENV{MO my $HAS_APACHE_TEST = check_for_apache_test(); +my $VERSION; +set_version(); + my %common_opts = ( + VERSION => $VERSION, PREREQ_PM => \%prereqs, clean => { FILES => 't/TEST' }, ); @@ -49,7 +53,6 @@ if ($mp_gen == 1 || $ENV{MAINTAINER_BUIL require ExtUtils::MakeMaker; ExtUtils::MakeMaker::WriteMakefile( %common_opts, - VERSION_FROM => "lib/Apache/SizeLimit.pm", NAME => "Apache::SizeLimit", ABSTRACT_FROM => 'lib/Apache/SizeLimit.pm', ); @@ -59,7 +62,6 @@ else { require ModPerl::MM; ModPerl::MM::WriteMakefile( %common_opts, - VERSION_FROM => "lib/Apache2/SizeLimit.pm", NAME => "Apache2::SizeLimit", ABSTRACT_FROM => 'lib/Apache2/SizeLimit.pm', ); @@ -68,7 +70,7 @@ else { sub check_for_apache_test { return unless eval { require Apache::Test; - if ($Apache::Test::VERSION < $at_min_ver) { + if ($Apache::Test::VERSION < $at_min_ver) { die "Apache::Test version is " . $Apache::Test::VERSION . ", minimum version required is $at_min_ver" . ", tests will be skipped\n"; @@ -87,6 +89,28 @@ sub check_for_apache_test { return 1; } +sub set_version { + # We cannot require Apache::SizeLimit or Apache2::SizeLimit to access their + # $VERSIONs because they depend on Apache::Constants / Apache2::Const and at + # least the latter cannot be loaded in a command-line script (at least not + # on Windows, where it fails to load because ModPerl/Const/Const.dll cannot + # be loaded). Even Apache::SizeLimit::Core cannot be loaded on Windows + # because it is not implemented on that platform. So instead we use MM's + # parse_version() method to read the $VERSION for us. + $VERSION = MM->parse_version('lib/Apache/SizeLimit.pm'); + + my $fh = Symbol::gensym(); + open $fh, 'Changes' or die "Can't open Changes: $!"; + while (<$fh>) { + if(/^=item.*-(dev|rc\d+)/) { + $VERSION .= "-$1"; + last; + } + last if /^=item/; + } + close $fh; +} + # If a specific generation was passed as an argument, # if satisfied # return the same generation Modified: perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm?rev=1911180&r1=1911179&r2=1911180&view=diff ============================================================================== --- perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm (original) +++ perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm Fri Jul 21 21:32:34 2023 @@ -26,7 +26,7 @@ use constant IS_WIN32 => $Config{'osname use vars qw($VERSION); -$VERSION = '0.98-dev'; +$VERSION = '0.98'; use Apache::SizeLimit::Core qw( $MAX_PROCESS_SIZE Modified: perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit/Core.pm URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit/Core.pm?rev=1911180&r1=1911179&r2=1911180&view=diff ============================================================================== --- perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit/Core.pm (original) +++ perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit/Core.pm Fri Jul 21 21:32:34 2023 @@ -47,7 +47,7 @@ use vars qw( $START_TIME ); -$VERSION = '0.98-dev'; +$VERSION = '0.98'; $REQUEST_COUNT = 1; Modified: perl/Apache-SizeLimit/trunk/lib/Apache2/SizeLimit.pm URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/lib/Apache2/SizeLimit.pm?rev=1911180&r1=1911179&r2=1911180&view=diff ============================================================================== --- perl/Apache-SizeLimit/trunk/lib/Apache2/SizeLimit.pm (original) +++ perl/Apache-SizeLimit/trunk/lib/Apache2/SizeLimit.pm Fri Jul 21 21:32:34 2023 @@ -34,7 +34,7 @@ die "Apache2::SizeLimit at the moment wo use constant IS_WIN32 => $Config{'osname'} eq 'MSWin32' ? 1 : 0; # 2.x requires 5.6.x+ so 'our' is okay -our $VERSION = '0.98-dev'; +our $VERSION = '0.98'; use Apache::SizeLimit::Core qw( $MAX_PROCESS_SIZE