Update of /cvsroot/fink/fink/perlmod/Fink
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv20143

Modified Files:
        ChangeLog Engine.pm PkgVersion.pm Validation.pm 
Log Message:
* Engine.pm: Allow maintainer mode with dumpinfo.             
* PkgVersion.pm: Implement InfoTest.
* Validation.pm: Preliminary support for InfoTest.


Index: PkgVersion.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/PkgVersion.pm,v
retrieving revision 1.560
retrieving revision 1.561
diff -u -d -r1.560 -r1.561
--- PkgVersion.pm       27 Aug 2006 01:34:23 -0000      1.560
+++ PkgVersion.pm       12 Sep 2006 05:21:06 -0000      1.561
@@ -194,7 +194,11 @@
                
                # We need to update %d, %D, %i and %I to adapt to changes in 
buildpath
                $self->_set_destdirs;
-               
+
+               if(Fink::Config::get_option("maintainermode")) {
+                       $self->activate_infotest;
+               }
+
                return $self;
        }
 }
@@ -1028,7 +1032,9 @@
                } else {
                        $default_script = "make install prefix=\%i\n";
                } 
-
+       } elsif($field eq 'testscript') {
+               $field_value = $self->param_default($field, 
'%{default_script}');
+               $default_script = "";
        } else {
                # should never get here
                die "Invalid script field for get_script: $field\n";
@@ -1048,6 +1054,43 @@
        return $script;
 }
 
+# Activate InfoTest fields.
+# This parses the InfoTest block and promotes the fields defined within.
+# So, it makes values defined in InfoTest override or alter the main
+# values as necessary.
+sub activate_infotest {
+       my $self = shift;
+       return if $self->{_test_activated};
+       $self->{_test_activated} = 1;
+
+       my $infotest = $self->param_default("InfoTest", "");
+       my $max_source = ($self->get_source_suffices)[-1] or 0;
+       my $test_properties = &read_properties_var(
+               "InfoTest of ".$self->get_fullname,
+               $self->param_default('InfoTest', ''), {remove_space => 1});
+       while(my($key, $val) = each(%$test_properties)) {
+               if($key =~ /^Test(Depends|Conflicts)$/i) {
+                       my $orig_field = "Build$1";
+                       my $orig_val = $self->param_default($orig_field, "");
+                       $orig_val .= ", " if $orig_val;
+                       $self->set_param($orig_field, "$orig_val$val");
+               } elsif($key =~ /^TestConfigureParams$/i) {
+                       $self->set_param('ConfigureParams',
+                               $self->param_default('ConfigureParams', "") .
+                               " $val");
+                       $self->prepare_percent_c;
+               } elsif($key =~ /^TestSource\d*$/i) {
+                       $max_source++;
+                       $self->set_param("Source$max_source", $val);
+               } else {
+                       $self->set_param($key, $val);
+               }
+       }
+
+       delete $self->{_source_suffices};
+       
+}
+
 ### add a splitoff package
 
 sub add_splitoff {
@@ -3292,6 +3335,21 @@
 
        ### construct CompileScript and execute it
        $self->run_script($self->get_script("CompileScript"), "compiling", 1, 
1);
+
+       if(Fink::Config::get_option("maintainermode")) {
+               my $result = $self->run_script($self->get_script("TestScript"), 
"testing", 0, 1, 1);
+
+               if($result == 1) { 
+                       warn "phase test: warning\n";
+               } elsif($result) {
+                       my $error = "phase test: " . $self->get_fullname()." 
failed";
+                       my $notifier = Fink::Notify->new();
+                       $notifier->notify(event => 'finkPackageBuildFailed', 
description => $error);
+                       die "phase test: error ($result)\n";
+               } else {
+                       warn "phase test: passed\n";
+               }
+       }
 }
 
 ### install
@@ -4670,6 +4728,7 @@
        my $phase = shift;
        my $no_expand = shift || 0;
        my $nonroot_okay = shift || 0;
+       my $ignore_result = shift || 0;
 
        # Expand percent shortcuts
        $script = &expand_percent($script, $self->{_expand}, 
$self->get_info_filename." $phase script") unless $no_expand;
@@ -4680,7 +4739,7 @@
                local %ENV = %{$self->get_env()};
                $result = &execute($script, nonroot_okay=>$nonroot_okay);
        }
-       if ($result) {
+       if ($result and !$ignore_result) {
                my $notifier = Fink::Notify->new();
                my $error = "phase " . $phase . ": " . $self->get_fullname()." 
failed";
                $notifier->notify(event => 'finkPackageBuildFailed', 
description => $error);
@@ -4698,6 +4757,7 @@
                }
                die $error . "\n";
        }
+       return $result;
 }
 
 

Index: Engine.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Engine.pm,v
retrieving revision 1.378
retrieving revision 1.379
diff -u -d -r1.378 -r1.379
--- Engine.pm   23 Aug 2006 23:40:55 -0000      1.378
+++ Engine.pm   12 Sep 2006 05:21:06 -0000      1.379
@@ -247,10 +247,10 @@
        }
 
        if (Fink::Config::get_option("maintainermode")) {
-               if (grep { $commands{$_}->[0] eq $proc } qw/ build rebuild 
install reinstall update /) {
+               if (grep { $commands{$_}->[0] eq $proc } qw/ build rebuild 
install reinstall update dumpinfo /) {
                        print STDERR "Running in Maintainer Mode\n";
                } else {
-                       &print_breaking("Maintainer mode is only available for 
(re)build, (re)install, and update. Continuing $cmd without maintainer 
mode...");
+                       &print_breaking("Maintainer mode is only available for 
(re)build, (re)install, update, and dumpinfo. Continuing $cmd without 
maintainer mode...");
                        Fink::Config::set_options( { "maintainermode" => 0 } );
                }
        }

Index: Validation.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Validation.pm,v
retrieving revision 1.228
retrieving revision 1.229
diff -u -d -r1.228 -r1.229
--- Validation.pm       15 Aug 2006 11:11:45 -0000      1.228
+++ Validation.pm       12 Sep 2006 05:21:06 -0000      1.229
@@ -213,7 +213,8 @@
                 'descdetail',
                 'descusage',
                 'descpackaging',
-                'descport'
+                'descport',
+                'infotest',
                )
        );
 
@@ -260,6 +261,7 @@
                 'descusage',
                 'descpackaging',
                 'descport',
+                'infotest',
                )
        );
 
@@ -270,6 +272,8 @@
         'BuildDepends',
         'Conflicts',
         'BuildConflicts',
+        'TestDepends',
+        'TestConflicts',
         'Provides',
         'Suggests',
         'Recommends',
@@ -277,6 +281,25 @@
         'Architecture',
        );
 
+# Extra fields valid inside InfoTest
+our %infotest_fields = map {lc $_, 1}
+       (
+        'TestDepends',
+        'TestConflicts',
+        'TestConfigureParams',
+        'TestScript',
+        'TestSource',
+        'TestSuiteSize',
+       );
+
+# Allowed values of the TestSuiteSize field
+our %allowed_testsuitesize_values = map {lc $_, 1}
+       (
+        'small',
+        'medium',
+        'large',
+       );
+
 END { }                                # module clean-up code here (global 
destructor)
 
 #

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.1372
retrieving revision 1.1373
diff -u -d -r1.1372 -r1.1373
--- ChangeLog   29 Aug 2006 23:54:21 -0000      1.1372
+++ ChangeLog   12 Sep 2006 05:21:05 -0000      1.1373
@@ -1,3 +1,9 @@
+2006-09-12  Matthew Sachs  <[EMAIL PROTECTED]>
+
+       * Engine.pm: Allow maintainer mode with dumpinfo.
+       * PkgVersion.pm: Implement InfoTest.
+       * Validation.pm: Preliminary support for InfoTest.
+
 2006-08-17  Daniel Macks  <[EMAIL PROTECTED]>
 
        * VirtPackage.pm: Check the perl version of the perl package, not


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to