Subversion Repositories DevTools

Rev

Rev 7082 | Rev 7155 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7082 Rev 7099
Line 178... Line 178...
178
     * <br>  -7 Pegged or SDK Imported package not in dpkg_archive
178
     * <br>  -7 Pegged or SDK Imported package not in dpkg_archive
179
     * <br>  -8 Pegged or SDK Imported package
179
     * <br>  -8 Pegged or SDK Imported package
180
     * <br>  -9 Rejected Daemon Instruction
180
     * <br>  -9 Rejected Daemon Instruction
181
     * <br>  -10 UnBuildable Package not in dpkg_archive
181
     * <br>  -10 UnBuildable Package not in dpkg_archive
182
     * <br>  -11 Marked as RippleStop
182
     * <br>  -11 Marked as RippleStop
-
 
183
     * <br>  -12 Cannot calc next version number
183
     * 
184
     * 
184
     */
185
     */
185
    int mBuildFile = 0;
186
    int mBuildFile = 0;
186
    
187
    
187
    /** Retained reason the package will not be built
188
    /** Retained reason the package will not be built
Line 385... Line 386...
385
     */
386
     */
386
    public boolean mIsProcessed = false;
387
    public boolean mIsProcessed = false;
387
 
388
 
388
    /**
389
    /**
389
     * Constructor
390
     * Constructor
390
     * Used to create planned packages. In these packages the change_type is significant
391
     * Used to create planned packages (WIP). In these packages the change_type is significant
391
     * 
392
     * 
392
     * @param pkg_id	   Package Name Identifier
393
     * @param pkgId	   Package Name Identifier
393
     * @param pv_id        Package Version Id
394
     * @param pvId        Package Version Id
394
     * @param pkg_name     Package Name
395
     * @param pkgName     Package Name
395
     * @param pkg_version  Package Version
396
     * @param pkgVersion  Package Version
396
     * @param v_ext        Package Suffix
397
     * @param vExt        Package Suffix
397
     * @param alias        Package Alias
398
     * @param alias        Package Alias
398
     * @param pkg_vcs_tag  Vcs Tag
399
     * @param pkgVcsTag  Vcs Tag
399
     * @param ripple_field Ripple Field
400
     * @param rippleField Ripple Field
400
     * @param change_type  Change Type
401
     * @param changeType  Change Type
401
     */
402
     */
402
    public Package(int pkg_id, int pv_id, String pkg_name, String pkg_version, String v_ext, String alias, String pkg_vcs_tag, char ripple_field, char change_type)
403
    public Package(int pkgId, int pvId, String pkgName, String pkgVersion, String vExt, String alias, String pkgVcsTag, char rippleField, char changeType)
403
    {
404
    {
404
        mLogger.debug("Package 1: pv_id " + pv_id + " pkg_name " + pkg_name + " v_ext " + v_ext + " alias " + alias
405
        mLogger.debug("Package 1: pv_id {} pkg_name {} v_ext {} alias {} pkg_vcs_tag {} ripple_field {} change_type {}", pvId, pkgName,vExt,alias, pkgVcsTag, rippleField, changeType);
405
                + " pkg_vcs_tag " + pkg_vcs_tag + " change_type " + change_type);
-
 
406
        mId = pv_id;
406
        mId = pvId;
407
        mName = pkg_name;
407
        mName = pkgName;
408
        mPid = pkg_id;
408
        mPid = pkgId;
409
        mVersion = "0.0.0000";
409
        mVersion = "0.0.0000";
410
        mExtension = v_ext;
410
        mExtension = vExt;
411
        mAlias = alias;
411
        mAlias = alias;
412
        mVcsTag = pkg_vcs_tag;
412
        mVcsTag = pkgVcsTag;
413
 
413
 
414
        // Remove the package suffix from package_version to create the fixed version number
414
        // Remove the package suffix from package_version to create the fixed version number
415
        mFixedVersion = pkg_version;
415
        mFixedVersion = pkgVersion;
416
        mFixedVersion = mFixedVersion.substring(0, mFixedVersion.length() - mExtension.length());
416
        mFixedVersion = mFixedVersion.substring(0, mFixedVersion.length() - mExtension.length());
417
 
417
 
418
        // a ripple_field of 'L' indicates this package has limited version numbering
418
        // a ripple_field of 'L' indicates this package has limited version numbering
419
        if (change_type == 'M') {
419
        if (changeType == 'M') {
420
            mChangeType.setMajor(ripple_field == 'L' ? true : false);
420
            mChangeType.setMajor(rippleField == 'L' ? true : false);
421
            
421
            
422
        } else if (change_type == 'N') {
422
        } else if (changeType == 'N') {
423
            mChangeType.setMinor(ripple_field == 'L' ? true : false);
423
            mChangeType.setMinor(rippleField == 'L' ? true : false);
424
            
424
            
425
        } else if (change_type == 'P') {
425
        } else if (changeType == 'P') {
426
            mChangeType.setPatch(ripple_field == 'L' ? true : false);
426
            mChangeType.setPatch(rippleField == 'L' ? true : false);
427
            
427
            
428
        } else if (change_type == 'F') {
428
        } else if (changeType == 'F') {
429
            mChangeType.setFixed();
429
            mChangeType.setFixed();
430
            
430
            
431
        } else {
431
        } else {
432
            mChangeType.setUnknown();
432
            mChangeType.setUnknown();
433
        }
433
        }
Line 435... Line 435...
435
 
435
 
436
    /**
436
    /**
437
     * Constructor
437
     * Constructor
438
     * Used to create existing packages, in these packages the ripple_field is significant
438
     * Used to create existing packages, in these packages the ripple_field is significant
439
     * 
439
     * 
440
     * @param pkg_id	   Package Name Identifier
440
     * @param pkgId	   Package Name Identifier
441
     * @param pv_id        Package Version Id
441
     * @param pvId        Package Version Id
442
     * @param pkg_name     Package Name
442
     * @param pkgName     Package Name
443
     * @param pkg_version  Package Version
443
     * @param pkgVersion  Package Version
444
     * @param v_ext        Package Suffix
444
     * @param vExt        Package Suffix
445
     * @param alias        Package Alias
445
     * @param alias        Package Alias
446
     * @param pkg_vcs_tag  Vcs Tag
446
     * @param pkgVcsTag  Vcs Tag
447
     * @param ripple_field Ripple Field
447
     * @param rippleField Ripple Field
448
     */
448
     */
449
    public Package(int pkg_id,int pv_id, String pkg_name, String pkg_version, String v_ext, String alias, String pkg_vcs_tag, char ripple_field)
449
    public Package(int pkgId,int pvId, String pkgName, String pkgVersion, String vExt, String alias, String pkgVcsTag, char rippleField)
450
    {
450
    {
451
        mLogger.debug("Package 2: pv_id " + pv_id + " pkg_name " + pkg_name + " pkg_version " + pkg_version + " v_ext "
451
        mLogger.debug("Package 2: pv_id {} pkg_name {} v_ext {} alias {} pkg_vcs_tag {} ripple_field {}", pvId, pkgName,vExt,alias, pkgVcsTag, rippleField);
452
                + v_ext + " alias " + alias + " pkg_vcs_tag " + pkg_vcs_tag + " ripple_field " + ripple_field);
-
 
453
        mId = pv_id;
452
        mId = pvId;
454
        mName = pkg_name;
453
        mName = pkgName;
455
        mPid = pkg_id;
454
        mPid = pkgId;
456
        mVersion = pkg_version;
455
        mVersion = pkgVersion;
457
        int endindex = mVersion.length() - v_ext.length();
456
        int endindex = mVersion.length() - vExt.length();
458
 
457
 
459
        if (endindex > 0)
458
        if (endindex > 0)
460
        {
459
        {
461
            mVersion = mVersion.substring(0, endindex);
460
            mVersion = mVersion.substring(0, endindex);
462
        }
461
        }
463
 
462
 
464
        mExtension = v_ext;
463
        mExtension = vExt;
465
        mAlias = alias;
464
        mAlias = alias;
466
        mVcsTag = pkg_vcs_tag;
465
        mVcsTag = pkgVcsTag;
467
 
466
 
468
        // setBuild is the default
467
        // setBuild is the default
469
        if (ripple_field == 'M') {
468
        if (rippleField == 'M') {
470
            mRippleField.setMajor();
469
            mRippleField.setMajor();
471
            
470
            
472
        } else if (ripple_field == 'm') {
471
        } else if (rippleField == 'm') {
473
            mRippleField.setMinor();
472
            mRippleField.setMinor();
474
            
473
            
475
        } else if (ripple_field == 'p') {
474
        } else if (rippleField == 'p') {
476
            mRippleField.setPatch();
475
            mRippleField.setPatch();
477
            
476
            
478
        } else if (ripple_field == 'L') {
477
        } else if (rippleField == 'L') {
479
            mRippleField.setLimit();
478
            mRippleField.setLimit();
480
        }
479
        }
481
    }
480
    }
482
 
481
 
483
    /**
482
    /**
Line 790... Line 789...
790
     */
789
     */
791
    
790
    
792
    int applyPV(ReleaseManager releaseManager) throws Exception
791
    int applyPV(ReleaseManager releaseManager) throws Exception
793
    {
792
    {
794
        String logInfo = "applyPV," + mName;
793
        String logInfo = "applyPV," + mName;
-
 
794
        String changeType = "";
795
        mLogger.debug("applyPV on Package " + mName);
795
        mLogger.error("applyPV on Package {}", mName);
796
        
796
        
797
        //
797
        //
798
        //  This method used to actually perform the version change
798
        //  This method used to actually perform the version change
799
        //  Now it just calculates the potential value
799
        //  Now it just calculates the potential value
800
        //  Must not alter mVersion as it will be used if the package is not selected to be built,
800
        //  Must not alter mVersion as it will be used if the package is not selected to be built,
Line 814... Line 814...
814
        if (!mDirectlyPlanned && mIndirectlyPlanned && !mArchivalExistence && mForcedRippleInstruction == 0)
814
        if (!mDirectlyPlanned && mIndirectlyPlanned && !mArchivalExistence && mForcedRippleInstruction == 0)
815
        {
815
        {
816
            // the package has an mIndirectlyPlanned flag set true in daemon
816
            // the package has an mIndirectlyPlanned flag set true in daemon
817
            // mode because the package does not exist in an archive
817
            // mode because the package does not exist in an archive
818
            // do not apply a different package version
818
            // do not apply a different package version
819
            mLogger.info("applyPV. Rebuild Package {}", mName);
819
            mLogger.error("applyPV. Rebuild Package {}", mName);
820
            mLogger.info("applyPv returned 0");
820
            mLogger.info("applyPv returned 0");
821
            return 0;
821
            return 0;
822
        }
822
        }
823
 
823
 
824
        // override - no longer doing a rebuild - version number change from this point on
824
        // override - no longer doing a rebuild - version number change from this point on
Line 839... Line 839...
839
        // Detect invalid change type
839
        // Detect invalid change type
840
        // Flagged when package instance is created
840
        // Flagged when package instance is created
841
        //
841
        //
842
        if (mChangeType.mUnknown)
842
        if (mChangeType.mUnknown)
843
        {
843
        {
844
            mLogger.info("Package Version specified on Package {} New Version: {}", mName, mVersion);
844
            mLogger.error("Package Version unknown on Package {} Version: {}", mName, mVersion);
845
            mLogger.info("applyPv returned 3");
845
            mLogger.info("applyPv returned 3");
846
            return 3;
846
            return 3;
847
        }
847
        }
848
 
848
 
849
        // If we are not calculating the new package version because the user
849
        // If we are not calculating the new package version because the user
Line 851... Line 851...
851
        if (mChangeType.mFixed)
851
        if (mChangeType.mFixed)
852
        {
852
        {
853
            // mVersion is already setup
853
            // mVersion is already setup
854
 
854
 
855
            mNextVersion = mFixedVersion;
855
            mNextVersion = mFixedVersion;
856
            mLogger.info("Package Version specified on Package {} New Version: {}", mName,  mVersion);
856
            mLogger.error("Package Version specified on Package {} New Version: {}", mName,  mNextVersion);
857
            mLogger.info("applyPv returned 0");
857
            mLogger.info("applyPv returned 0");
858
            return 0;
858
            return 0;
859
        }
859
        }
860
 
860
 
861
        // We need to calculate the new version number
861
        // We need to calculate the new version number
Line 923... Line 923...
923
        // mChangeType overrides mRippleField
923
        // mChangeType overrides mRippleField
924
        do
924
        do
925
        {
925
        {
926
            if (mChangeType.mMajor)
926
            if (mChangeType.mMajor)
927
            {
927
            {
928
                logInfo += ",CT Major";
928
                changeType = ",CT Major";
929
                if (!incrementFieldsAccordingToLimits(4, major, minor, patch))
929
                if (!incrementFieldsAccordingToLimits(4, major, minor, patch))
930
                {
930
                {
931
                    mLogger.info("applyPv returned 2");
931
                    mLogger.info("applyPv returned 2");
932
                    mVersion = originalVersion;
932
                    mVersion = originalVersion;
933
                    return 2;
933
                    return 2;
934
                }
934
                }
935
            } else if (mChangeType.mMinor)
935
            } else if (mChangeType.mMinor)
936
            {
936
            {
937
                logInfo += ",CT Minor";
937
                changeType = ",CT Minor";
938
                if (!incrementFieldsAccordingToLimits(3, major, minor, patch))
938
                if (!incrementFieldsAccordingToLimits(3, major, minor, patch))
939
                {
939
                {
940
                    mLogger.info("applyPv returned 2");
940
                    mLogger.info("applyPv returned 2");
941
                    mVersion = originalVersion;
941
                    mVersion = originalVersion;
942
                    return 2;
942
                    return 2;
943
                }
943
                }
944
            } else if (mChangeType.mPatch)
944
            } else if (mChangeType.mPatch)
945
            {
945
            {
946
                logInfo += ",CT Patch";
946
                changeType = ",CT Patch";
947
                if (!incrementFieldsAccordingToLimits(2, major, minor, patch))
947
                if (!incrementFieldsAccordingToLimits(2, major, minor, patch))
948
                {
948
                {
949
                    mLogger.info("applyPv returned 2");
949
                    mLogger.info("applyPv returned 2");
950
                    mVersion = originalVersion;
950
                    mVersion = originalVersion;
951
                    return 2;
951
                    return 2;
952
                }
952
                }
953
            } else
953
            } else
954
            {
954
            {
955
                if (mRippleField.mMajor)
955
                if (mRippleField.mMajor)
956
                {
956
                {
957
                    logInfo += ",R Major";
957
                    changeType = ",R Major";
958
                    major.value++;
958
                    major.value++;
959
                    mLogger.info("applyPV mRippleField.mMajor {}", major.value);
959
                    mLogger.info("applyPV mRippleField.mMajor {}", major.value);
960
                    minor.value = 0;
960
                    minor.value = 0;
961
                    patch.value = 0;
961
                    patch.value = 0;
962
                } else if (mRippleField.mMinor)
962
                } else if (mRippleField.mMinor)
963
                {
963
                {
964
                    logInfo += ",R Minor";
964
                    changeType = ",R Minor";
965
                    minor.value++;
965
                    minor.value++;
966
                    mLogger.info("applyPV mRippleField.mMinor {}", minor.value);
966
                    mLogger.info("applyPV mRippleField.mMinor {}", minor.value);
967
                    patch.value = 0;
967
                    patch.value = 0;
968
                } else if (mRippleField.mPatch)
968
                } else if (mRippleField.mPatch)
969
                {
969
                {
970
                    logInfo += ",R Patch";
970
                    changeType = ",R Patch";
971
                    patch.value = ((patch.value / 1000) + 1) * 1000; 
971
                    patch.value = ((patch.value / 1000) + 1) * 1000; 
972
                    mLogger.info("applyPV mRippleField.mPatch {}", patch.value);
972
                    mLogger.info("applyPV mRippleField.mPatch {}", patch.value);
973
                } else if (mRippleField.mBuild)
973
                } else if (mRippleField.mBuild)
974
                {
974
                {
975
                    logInfo += ", R Build";
975
                    changeType = ", R Build";
976
                    patch.value++;
976
                    patch.value++;
977
                    mLogger.info("applyPV mRippleField.mBuild {}", patch.value);
977
                    mLogger.info("applyPV mRippleField.mBuild {}", patch.value);
978
                } else
978
                } else
979
                {
979
                {
980
                    if (!incrementFieldsAccordingToLimits(1, major, minor, patch))
980
                    if (!incrementFieldsAccordingToLimits(1, major, minor, patch))
Line 1006... Line 1006...
1006
            }
1006
            }
1007
 
1007
 
1008
            mVersion += String.valueOf(patch.value);
1008
            mVersion += String.valueOf(patch.value);
1009
        } while (exists(releaseManager));
1009
        } while (exists(releaseManager));
1010
 
1010
 
1011
        logInfo += ", Next Version:" + mVersion;
1011
        logInfo += changeType + ", Next Version:" + mVersion;
1012
        mLogger.error(logInfo);
1012
        mLogger.error(logInfo);
1013
        mLogger.info("applyPv returned 0");
1013
        mLogger.info("applyPv returned 0");
1014
        mNextVersion = mVersion;
1014
        mNextVersion = mVersion;
1015
        mVersion = originalVersion;
1015
        mVersion = originalVersion;
1016
        return 0;
1016
        return 0;