Randy Kobes wrote:
On Tue, 4 Jan 2005, Stas Bekman wrote:


As noted the PAUSE indexer can't index any of our
autogenerated files, since they aren't in the distro that
gets uploaded to CPAN. As we really need to get RC3 out
tomorrow, the following temp solution resolves this
problem, by autogenerating lib/ModPerl/DummyVersions.pm
which looks like:

[ .. ]

the issues:

1) I'm not sure APR modules should get their versions as
2.0.0. Should it be 0.9 instead? since Apache 2.0 uses
libapr 0.9.x.


+1: that seems to make sense.


2) This module will get installed so we should adjust MM rules to ignore
it on make install.


+1 for that as well.

Haven't addressed this issue, yet

I'm not sure it matters, but should the version specified in
DummyVersions.pm match that which is found in the
auto-generated file when things are built (0.01, I believe)?

I think those should match the mp2 version. So now we get:

#
# /*
#  * *********** WARNING **************
#  * This file generated by ModPerl::WrapXS/0.01
#  * Any changes made here will be lost
#  * ***********************************
#  * 01: lib/ModPerl/Code.pm:702
#  * 02: /home/stas/apache.org/mp2-pool/lib/ModPerl/WrapXS.pm:1082
#  * 03: /home/stas/apache.org/mp2-pool/lib/ModPerl/WrapXS.pm:1132
#  * 04: Makefile.PL:413
#  * 05: Makefile.PL:317
#  * 06: Makefile.PL:53
#  */
#

package APR::Util;
$APR::Util::VERSION             = 0.900000;

package APR::Base64;
$APR::Base64::VERSION           = 0.900000;

package Apache::URI;
$Apache::URI::VERSION           = 1.099020;

package APR::Bucket;
$APR::Bucket::VERSION           = 0.900000;

package Apache::FilterRec;
$Apache::FilterRec::VERSION     = 1.099020;

package APR::Finfo;
$APR::Finfo::VERSION            = 0.900000;

package APR::SockAddr;
$APR::SockAddr::VERSION         = 0.900000;

package ModPerl::Global;
$ModPerl::Global::VERSION       = 1.099020;

package Apache::CmdParms;
$Apache::CmdParms::VERSION      = 1.099020;

package APR::BucketType;
$APR::BucketType::VERSION       = 0.900000;

package Apache::ServerUtil;
$Apache::ServerUtil::VERSION    = 1.099020;

package Apache::ServerRec;
$Apache::ServerRec::VERSION     = 1.099020;

package APR::Error;
$APR::Error::VERSION            = 0.900000;

package Apache::Connection;
$Apache::Connection::VERSION    = 1.099020;

package Apache::HookRun;
$Apache::HookRun::VERSION       = 1.099020;

package Apache::SubProcess;
$Apache::SubProcess::VERSION    = 1.099020;

package APR::Date;
$APR::Date::VERSION             = 0.900000;

package Apache::Module;
$Apache::Module::VERSION        = 1.099020;

package APR::UUID;
$APR::UUID::VERSION             = 0.900000;

package APR::Table;
$APR::Table::VERSION            = 0.900000;

package Apache::RequestUtil;
$Apache::RequestUtil::VERSION   = 1.099020;

package ModPerl::Util;
$ModPerl::Util::VERSION         = 1.099020;

package Apache::Access;
$Apache::Access::VERSION        = 1.099020;

package Apache::Log;
$Apache::Log::VERSION           = 1.099020;

package Apache::Process;
$Apache::Process::VERSION       = 1.099020;

package APR::URI;
$APR::URI::VERSION              = 0.900000;

package APR::Brigade;
$APR::Brigade::VERSION          = 0.900000;

package APR::ThreadMutex;
$APR::ThreadMutex::VERSION      = 0.900000;

package APR::BucketAlloc;
$APR::BucketAlloc::VERSION      = 0.900000;

package Apache::Util;
$Apache::Util::VERSION          = 1.099020;

package Apache::MPM;
$Apache::MPM::VERSION           = 1.099020;

package APR::IpSubnet;
$APR::IpSubnet::VERSION         = 0.900000;

package Apache::Command;
$Apache::Command::VERSION       = 1.099020;

package Apache::SubRequest;
$Apache::SubRequest::VERSION    = 1.099020;

package APR::OS;
$APR::OS::VERSION               = 0.900000;

package Apache::RequestRec;
$Apache::RequestRec::VERSION    = 1.099020;

package Apache::RequestIO;
$Apache::RequestIO::VERSION     = 1.099020;

package APR::Socket;
$APR::Socket::VERSION           = 0.900000;

package Apache::Directive;
$Apache::Directive::VERSION     = 1.099020;

package APR::String;
$APR::String::VERSION           = 0.900000;

package Apache::Response;
$Apache::Response::VERSION      = 1.099020;

package APR::Pool;
$APR::Pool::VERSION             = 0.900000;

package Apache::Filter;
$Apache::Filter::VERSION        = 1.099020;

package ModPerl::MethodLookup;
$ModPerl::MethodLookup::VERSION = 1.099020;

notice that it already uses the other patch that introduces the new version convention.

and here is the patch:

Index: lib/ModPerl/Manifest.pm
===================================================================
--- lib/ModPerl/Manifest.pm     (revision 123827)
+++ lib/ModPerl/Manifest.pm     (working copy)
@@ -58,6 +58,9 @@

     }}, $cwd);

+    # files to add which aren't under svn
+    push @files, qw(lib/ModPerl/DummyVersions.pm);
+
     return @files;
 }

Index: lib/ModPerl/WrapXS.pm
===================================================================
--- lib/ModPerl/WrapXS.pm       (revision 123827)
+++ lib/ModPerl/WrapXS.pm       (working copy)
@@ -1072,6 +1072,33 @@
     close $fh;
 }

+sub write_module_versions_file {
+    my $self = shift;
+
+    my $file = catfile "lib", "ModPerl", "DummyVersions.pm";
+    debug "creating $file";
+    open my $fh, ">$file" or die "Can't open $file: $!";
+
+    my $noedit_warning = $self->ModPerl::Code::noedit_warning_hash();
+    print $fh "$noedit_warning\n";
+
+    my @modules = keys %{ $self->{XS} };
+    push @modules, qw(ModPerl::MethodLookup);
+
+    my $len = 0;
+    for (@modules) {
+        $len = length $_ if length $_ > $len;
+    }
+
+    require mod_perl;
+    $len += length '$::VERSION';
+    for (@modules) {
+        my $ver = /^APR/ ? "0.900000" : "$mod_perl::VERSION";
+        printf $fh "package %s;\n%-${len}s = %s;\n\n",
+            $_, '$'.$_."::VERSION", $ver;
+    }
+}
+
 sub generate {
     my $self = shift;

@@ -1103,6 +1130,7 @@
     }

     $self->write_lookup_method_file;
+    $self->write_module_versions_file;
 }

 #three .sym files are generated:


-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to