httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ran...@apache.org
Subject svn commit: r170878 - /httpd/apreq/trunk/build/version_check.pl
Date Thu, 19 May 2005 05:55:31 GMT
Author: randyk
Date: Wed May 18 22:55:30 2005
New Revision: 170878

URL: http://svn.apache.org/viewcvs?rev=170878&view=rev
Log:
generate APR::DummyVersions under glue/perl/lib/, containing
just package names and versions of those packages to be provided.

Modified:
    httpd/apreq/trunk/build/version_check.pl

Modified: httpd/apreq/trunk/build/version_check.pl
URL: http://svn.apache.org/viewcvs/httpd/apreq/trunk/build/version_check.pl?rev=170878&r1=170877&r2=170878&view=diff
==============================================================================
--- httpd/apreq/trunk/build/version_check.pl (original)
+++ httpd/apreq/trunk/build/version_check.pl Wed May 18 22:55:30 2005
@@ -103,6 +103,43 @@
     return $prereq_string;
 }
 
+sub print_dummy_versions {
+    require File::Spec;
+    my $version = shift;
+    my @mods = qw(APR::Request);
+    push @mods, 
+        (map {"APR::Request::$_"} qw(Apache2 CGI Error Cookie Param)),
+            (map {"Apache2::$_"} qw(Request Cookie Upload));
+    my $dummy_versions = File::Spec->catfile(qw(glue perl lib APR),
+                                             'DummyVersions.pm');
+    my $len = 0;
+    for (@mods) {
+        $len = length $_ if length $_ > $len;
+    }
+    $len += length '$::VERSION';
+
+    my $warning = << 'WARN';
+
+********************** WARNING ************************
+  This file was generated by build/version_check.pl
+  Any changes made here will be lost.
+*******************************************************
+
+WARN
+  
+    $warning =~ s/^/\# /mg;
+    open(my $fh, '>', $dummy_versions)
+        or die "Cannot open $dummy_versions for writing: $!";
+    print $fh $warning;
+
+    for my $mod (@mods) {
+        printf $fh "\npackage %s;\n%-${len}s = %s;\n",
+            $mod, '$'.$mod."::VERSION", $version;
+    }
+    print $fh "\n\n1;\n";
+    close $fh;
+}
+
 if ($path eq 'perl_prereqs') {
     print perl_prereqs();
     exit;
@@ -151,6 +188,7 @@
                                );
         print_prereqs "requires:", \%runtime_prereqs;
         print_prereqs "build_requires:", \%perl_glue;
+        print_dummy_versions($opts{version});
     }
 
     else {                     # generate PREREQUISITES file content



Mime
View raw message