Subversion Repositories DevTools

Rev

Blame | Last modification | View Log | RSS feed

CREATE PROCEDURE "RELEASE_MANAGER"."REBUILD_ENVIRONMENT" ( NNrtag_id IN NUMBER ) IS

/* ---------------------------------------------------------------------------
    Version: 3.3
   --------------------------------------------------------------------------- */
    rowCnt NUMBER := 0;
    iteration NUMBER := 2;          -- Iterations counter
    maxIterations NUMBER := 50;    -- Maximum number of iterations allowed.
                                    -- This will prevent infinite loops if cyrcular dependencies are found
    sessionNum NUMBER;
BEGIN
    SELECT SEQ_session_num.nextval INTO sessionNum FROM DUAL;


    -- Redo Patch Ignore warnings
    Ignore_Dependency_Warnings ( NNrtag_id, NULL, NULL, TRUE );


    Level_One_Conflicts ( NNrtag_id, sessionNum );
        
    LOOP
        Level_N_Conflicts ( NNrtag_id, sessionNum, rowCnt, iteration );
        iteration := iteration + 1;
        EXIT WHEN (rowCnt < 1) OR (iteration > maxIterations);
    END LOOP;

    Update_Package_States ( NNrtag_id, sessionNum );

    DELETE FROM temp_env_states WHERE temp_env_states.session_num = sessionNum;

    -- Flag Packages with New Patches Available
    Check_New_Patches ( NNrtag_id );
        
        Clean_Do_Not_Ripple( NNrtag_id );


        /* Circular Dependency Flag */
    /*
        IF iteration > maxIterations
        THEN
                UPDATE release_tags SET
                           circular_dependency = 'Y'
                 WHERE rtag_id = NNrtag_id;
        ELSE
                UPDATE release_tags SET
                           circular_dependency = NULL
                 WHERE rtag_id = NNrtag_id;
        END IF;
    */
END Rebuild_Environment;
/