perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject [mp2 patch] lib/ModPerl/DummyVersions.pm
Date Tue, 04 Jan 2005 05:28:13 GMT
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:

#
# /*
#  * *********** 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:1128
#  * 04: Makefile.PL:413
#  * 05: Makefile.PL:317
#  * 06: Makefile.PL:53
#  */
#

package APR::Util;
$APR::Util::VERSION = 2.000_000;
package APR::Base64;
$APR::Base64::VERSION = 2.000_000;
package Apache::URI;
$Apache::URI::VERSION = 2.000_000;
package APR::Bucket;
$APR::Bucket::VERSION = 2.000_000;
package Apache::FilterRec;
$Apache::FilterRec::VERSION = 2.000_000;
package APR::Finfo;
$APR::Finfo::VERSION = 2.000_000;
package APR::SockAddr;
$APR::SockAddr::VERSION = 2.000_000;
package ModPerl::Global;
$ModPerl::Global::VERSION = 2.000_000;
package Apache::CmdParms;
$Apache::CmdParms::VERSION = 2.000_000;
package APR::BucketType;
$APR::BucketType::VERSION = 2.000_000;
package Apache::ServerUtil;
$Apache::ServerUtil::VERSION = 2.000_000;
package Apache::ServerRec;
$Apache::ServerRec::VERSION = 2.000_000;
package APR::Error;
$APR::Error::VERSION = 2.000_000;
package Apache::Connection;
$Apache::Connection::VERSION = 2.000_000;
package Apache::HookRun;
$Apache::HookRun::VERSION = 2.000_000;
package Apache::SubProcess;
$Apache::SubProcess::VERSION = 2.000_000;
package APR::Date;
$APR::Date::VERSION = 2.000_000;
package Apache::Module;
$Apache::Module::VERSION = 2.000_000;
package APR::UUID;
$APR::UUID::VERSION = 2.000_000;
package APR::Table;
$APR::Table::VERSION = 2.000_000;
package Apache::RequestUtil;
$Apache::RequestUtil::VERSION = 2.000_000;
package ModPerl::Util;
$ModPerl::Util::VERSION = 2.000_000;
package Apache::Access;
$Apache::Access::VERSION = 2.000_000;
package Apache::Log;
$Apache::Log::VERSION = 2.000_000;
package Apache::Process;
$Apache::Process::VERSION = 2.000_000;
package APR::URI;
$APR::URI::VERSION = 2.000_000;
package APR::Brigade;
$APR::Brigade::VERSION = 2.000_000;
package APR::ThreadMutex;
$APR::ThreadMutex::VERSION = 2.000_000;
package APR::BucketAlloc;
$APR::BucketAlloc::VERSION = 2.000_000;
package Apache::Util;
$Apache::Util::VERSION = 2.000_000;
package Apache::MPM;
$Apache::MPM::VERSION = 2.000_000;
package APR::IpSubnet;
$APR::IpSubnet::VERSION = 2.000_000;
package Apache::Command;
$Apache::Command::VERSION = 2.000_000;
package Apache::SubRequest;
$Apache::SubRequest::VERSION = 2.000_000;
package APR::OS;
$APR::OS::VERSION = 2.000_000;
package Apache::RequestRec;
$Apache::RequestRec::VERSION = 2.000_000;
package Apache::RequestIO;
$Apache::RequestIO::VERSION = 2.000_000;
package APR::Socket;
$APR::Socket::VERSION = 2.000_000;
package Apache::Directive;
$Apache::Directive::VERSION = 2.000_000;
package APR::String;
$APR::String::VERSION = 2.000_000;
package Apache::Response;
$Apache::Response::VERSION = 2.000_000;
package APR::Pool;
$APR::Pool::VERSION = 2.000_000;
package Apache::Filter;
$Apache::Filter::VERSION = 2.000_000;
package ModPerl::MethodLookup;
$ModPerl::MethodLookup::VERSION = 2.000_000;


and it gets included in the distro. And the indexer gets the idea of what 
versions modperl ships with.

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.

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

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,28 @@
      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);
+
+    for (@modules) {
+        print $fh <<EOF;
+package $_;
+\$$_\::VERSION = 2.000_000;
+EOF
+
+    }
+}
+
  sub generate {
      my $self = shift;

@@ -1103,6 +1125,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:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message