Subversion Repositories DevTools

Rev

Rev 874 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 874 Rev 888
Line 420... Line 420...
420
    int major = 0;
420
    int major = 0;
421
    int minor = 0;
421
    int minor = 0;
422
    int patch = 1000;
422
    int patch = 1000;
423
 
423
 
424
    String field[] = mVersion.split("\\D");
424
    String field[] = mVersion.split("\\D");
-
 
425
    String nonStandardCotsVersion = "";
425
    
426
 
426
    if ( field.length == 3 )
427
    if ( field.length == 3 )
427
    {
428
    {
428
      major = Integer.parseInt(field[0]);
429
      major = Integer.parseInt(field[0]);
429
      minor = Integer.parseInt(field[1]);
430
      minor = Integer.parseInt(field[1]);
430
      patch = Integer.parseInt(field[2]);
431
      patch = Integer.parseInt(field[2]);
431
    }
432
    }
432
    else
433
    else
433
    {
434
    {
-
 
435
      if ( !mChangeType.mMajor &&
-
 
436
           !mChangeType.mMinor &&
-
 
437
           !mChangeType.mPatch &&
-
 
438
           mRippleField.mBuild &&
-
 
439
           mExtension.compareTo(".cots") == 0 &&
-
 
440
           field.length > 0 )
-
 
441
      {
-
 
442
        // DEVI 52782
-
 
443
        // allow and work with (ripple build) versions a.b.c.d....xxxx
-
 
444
        // where xxxx.length > 3
-
 
445
        String patchStr = field[field.length - 1];
-
 
446
        int patchLen = patchStr.length();
-
 
447
        
-
 
448
        // check patchStr is the last (at least 4) digits
-
 
449
        if ( patchLen > 3 && mVersion.substring( mVersion.length() - patchLen, mVersion.length() ).compareTo(patchStr) == 0 )
-
 
450
        {
-
 
451
          patch = Integer.parseInt(patchStr);
-
 
452
          nonStandardCotsVersion = mVersion.substring(0, mVersion.length() - patchLen );
-
 
453
        }
-
 
454
      }
-
 
455
      
-
 
456
      if ( nonStandardCotsVersion.length() == 0 )
-
 
457
      {
434
      // cannot work with non standard versioning
458
        // cannot work with non standard versioning
435
      mLogger.error("applyPV cannot work with non standard versioning");
459
        mLogger.error("applyPV cannot work with non standard versioning");
436
      mLogger.info("applyPv returned 1");
460
        mLogger.info("applyPv returned 1");
437
      return 1;
461
        return 1;
-
 
462
      }
438
    }
463
    }
439
 
464
 
-
 
465
    if ( nonStandardCotsVersion.length() == 0 &&
-
 
466
         patch < 1000 && 
440
    if ( patch < 1000 && field[2].substring(0, 1).compareTo("0") != 0 )
467
         field[2].substring(0, 1).compareTo("0") != 0 )
441
    {
468
    {
442
      mLogger.info("applyPV accomodate old style mVersion of the form 1.0.1");
469
      mLogger.info("applyPV accomodate old style mVersion of the form 1.0.1");
443
      patch = patch * 1000;
470
      patch = patch * 1000;
444
    }
471
    }
445
      
472
      
Line 579... Line 606...
579
            mLogger.info("applyPv returned 2");
606
            mLogger.info("applyPv returned 2");
580
            return 2;
607
            return 2;
581
          }
608
          }
582
        }
609
        }
583
      }
610
      }
-
 
611
 
-
 
612
      if ( nonStandardCotsVersion.length() == 0 )
584
      
613
      {
585
      mVersion = String.valueOf(major) + "." + String.valueOf(minor) + ".";
614
        mVersion = String.valueOf(major) + "." + String.valueOf(minor) + ".";
-
 
615
      }
-
 
616
      else
-
 
617
      {
-
 
618
        mVersion = nonStandardCotsVersion;
-
 
619
      }
586
      
620
      
587
      if ( patch < 10 )
621
      if ( patch < 10 )
588
      {
622
      {
589
        mVersion += "000";
623
        mVersion += "000";
590
      }
624
      }