Show
Ignore:
Timestamp:
12/08/07 11:22:20 (1 year ago)
Author:
finley
Message:
  • New upstream version:
    • Change -> count all non-implemented changes with $error_level
    • Automatically loop until no more changes can be implemented.
      • This allows --yes to implement all changes, including those with
        dependencies satisfied later in the process.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/SystemStateManager.pm

    r192 r195  
    33# 
    44#   $Id$ 
    5 #    vi: set filetype=perl
     5#    vi: set filetype=perl tw=0
    66#  
    77 
     
    8585################################################################################ 
    8686 
    87  
     87################################################################################ 
     88
     89#   Variables and What Not 
    8890# 
    8991# Hash for holding package information 
     
    112114 
    113115my $ERROR_LEVEL = 0; 
    114  
     116
    115117################################################################################ 
     118 
     119################################################################################ 
    116120# 
    117121#   Subroutines 
    118122# 
     123sub _initialize_variables { 
     124 
     125    (   %PKGS_FROM_STATE_DEFINITION, 
     126        %PKGS_PROVIDED_BY_PKGS_FROM_STATE_DEFINITION, 
     127        %TYPE, 
     128        %MODE, 
     129        %OWNER, 
     130        %GROUP, 
     131        %MD5SUM, 
     132        %MAJOR, 
     133        %MINOR, 
     134        %TARGET, 
     135        %PRESCRIPT, 
     136        %POSTSCRIPT, 
     137        %DEPENDS, 
     138        %DETAILS, 
     139        %PRIORITY, 
     140    ) = (); 
     141     
     142    $ERROR_LEVEL = 0; 
     143 
     144    return 1; 
     145} 
     146 
    119147sub read_definition_file { 
     148 
     149    _initialize_variables(); 
     150 
     151    if( $main::o{debug} ) { print "read_definition_file()\n"; } 
    120152 
    121153    unless( defined($main::o{definition_file}) ) { 
     
    287319 
    288320                $ERROR_LEVEL++; 
     321                if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    289322 
    290323                # We go ahead and exit here to be super conservative. 
     
    307340                print "\n"; 
    308341                $ERROR_LEVEL++; 
     342                if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    309343 
    310344            } else { 
     
    432466 
    433467                $ERROR_LEVEL++; 
     468                if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    434469 
    435470                # We go ahead and exit here to be super conservative. 
     
    473508    turn_groupnames_into_gids(); 
    474509 
    475     return 1
     510    return $ERROR_LEVEL
    476511} 
    477512 
     
    534569            print "\n"; 
    535570            $ERROR_LEVEL++; 
     571            if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    536572        } 
    537573 
     
    660696            } else { 
    661697                print "  Ok, skipping this step.\n"; 
     698                $ERROR_LEVEL++; 
     699                if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    662700                sleep 1; 
    663701            } 
     
    729767            } else { 
    730768                print "  Ok, skipping this step.\n"; 
     769                $ERROR_LEVEL++; 
     770                if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    731771                sleep 1; 
    732772            } 
     
    798838            } else { 
    799839                print "  Ok, skipping this step.\n"; 
     840                $ERROR_LEVEL++; 
     841                if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    800842                sleep 1; 
    801843            } 
     
    830872            } else { 
    831873                print "  Ok, skipping this step.\n"; 
     874                $ERROR_LEVEL++; 
     875                if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    832876                sleep 1; 
    833877            } 
     
    15381582            } else { 
    15391583                print "  Ok, skipping this step.\n"; 
     1584                $ERROR_LEVEL++; 
     1585                if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    15401586                sleep 1; 
    15411587            } 
     
    15431589        } else { 
    15441590            $ERROR_LEVEL++; 
     1591            if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    15451592        } 
    15461593 
     
    16891736            } else { 
    16901737                print "  Ok, skipping this step.\n"; 
     1738                $ERROR_LEVEL++; 
     1739                if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    16911740                sleep 1; 
    16921741            } 
     
    16941743        } else { 
    16951744            $ERROR_LEVEL++; 
     1745            if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    16961746        } 
    16971747 
     
    18121862            } else { 
    18131863                print "  Ok, skipping this step.\n"; 
     1864                $ERROR_LEVEL++; 
     1865                if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    18141866                sleep 1; 
    18151867            } 
     
    18171869        } else { 
    18181870            $ERROR_LEVEL++; 
     1871            if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    18191872        } 
    18201873    } 
     
    19051958            } else { 
    19061959                print "  Ok, skipping this step.\n"; 
     1960                $ERROR_LEVEL++; 
     1961                if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    19071962                sleep 1; 
    19081963            } 
     
    19101965        } else { 
    19111966            $ERROR_LEVEL++; 
     1967            if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    19121968        } 
    19131969 
     
    20002056            } else { 
    20012057                print "  Ok, skipping this step.\n"; 
     2058                $ERROR_LEVEL++; 
     2059                if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    20022060                sleep 1; 
    20032061            } 
     
    20052063        } else { 
    20062064            $ERROR_LEVEL++; 
     2065            if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    20072066        } 
    20082067 
     
    22222281        } 
    22232282        $ERROR_LEVEL++; 
     2283        if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    22242284        return 1; 
    22252285    }  
     
    22712331            } else { 
    22722332                print "  Ok, skipping this step.\n"; 
     2333                $ERROR_LEVEL++; 
     2334                if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    22732335                sleep 1; 
    22742336            } 
    22752337        } else { 
    22762338            $ERROR_LEVEL++; 
     2339            if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    22772340        } 
    22782341 
     
    23392402 
    23402403    $ERROR_LEVEL++; 
     2404    if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    23412405 
    23422406    return 1; 
     
    23962460 
    23972461    $ERROR_LEVEL++; 
     2462    if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    23982463 
    23992464    return 1; 
     
    26912756        print "\n"; 
    26922757        $ERROR_LEVEL++; 
     2758        if($main::o{debug}) { print "ERROR_LEVEL: $ERROR_LEVEL\n"; } 
    26932759        exit $ERROR_LEVEL; 
    26942760    }