Subversion Repositories DevTools

Rev

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

Rev 892 Rev 896
Line 167... Line 167...
167
  /**deploy archive location
167
  /**deploy archive location
168
   * @attribute
168
   * @attribute
169
   */
169
   */
170
  public static final String mGbeDply = System.getenv("GBE_DPLY");
170
  public static final String mGbeDply = System.getenv("GBE_DPLY");
171
 
171
 
-
 
172
  /**Exception message used upon detection an archive does not exist
-
 
173
   * Seems this is a rare but transient and recoverable scenario
-
 
174
   * @attribute
-
 
175
   */
-
 
176
  public static final String mRecoverable = "dpkg or deploy_archive do not exist, recovery will be attempted";
-
 
177
 
172
  /**true if the package exists in the dpkg or deploy archive
178
  /**true if the package exists in the dpkg or deploy archive
173
   * @attribute
179
   * @attribute
174
   */
180
   */
175
  private boolean mArchivalExistence = true;
181
  private boolean mArchivalExistence = true;
176
 
182
 
Line 743... Line 749...
743
    
749
    
744
    mLogger.info("exists 1 returned " + retVal);
750
    mLogger.info("exists 1 returned " + retVal);
745
    return retVal;
751
    return retVal;
746
  }
752
  }
747
 
753
 
-
 
754
  /**returns true if the dpkg_archive and deploy_archive exist
-
 
755
   * attempt to recover from their transient loss 
-
 
756
   */
-
 
757
  public static boolean recover()
-
 
758
  {
-
 
759
    mLogger.debug("recover");
-
 
760
    boolean retVal = false;
-
 
761
 
-
 
762
    String Release = mGbeDpkg;
-
 
763
    String Deploy = mGbeDply;
-
 
764
 
-
 
765
    if (Release != null && Deploy != null)
-
 
766
    {
-
 
767
      File dpkg = new File(mGbeDpkg);
-
 
768
      File dply = new File(mGbeDply);
-
 
769
      
-
 
770
      if ( dpkg.exists() && dply.exists() )
-
 
771
      {
-
 
772
        retVal = true;
-
 
773
      }
-
 
774
    }
-
 
775
    
-
 
776
    mLogger.info("recover returned " + retVal);
-
 
777
    return retVal;
-
 
778
  }
-
 
779
  
748
  /**returns true if the version exists in the dpkg_archive or deploy_archive
780
  /**returns true if the version exists in the dpkg_archive or deploy_archive
749
   */
781
   */
750
  boolean exists()
782
  boolean exists()
751
    throws Exception
783
    throws Exception
752
  {
784
  {
Line 759... Line 791...
759
    if (Release == null || Deploy == null)
791
    if (Release == null || Deploy == null)
760
    {
792
    {
761
      mLogger.fatal("exists 2 Release == null || Deploy == null");
793
      mLogger.fatal("exists 2 Release == null || Deploy == null");
762
      throw new Exception("exists 2 Release == null || Deploy == null");
794
      throw new Exception("exists 2 Release == null || Deploy == null");
763
    }
795
    }
-
 
796
    
-
 
797
    File dpkg = new File(mGbeDpkg);
-
 
798
    File dply = new File(mGbeDply);
-
 
799
    
-
 
800
    if ( !dpkg.exists() || !dply.exists() )
-
 
801
    {
-
 
802
      mLogger.fatal("exists 2 " + mRecoverable);
-
 
803
      throw new Exception(mRecoverable);
-
 
804
    }
764
 
805
 
765
    String fs = System.getProperty( "file.separator" );
806
    String fs = System.getProperty( "file.separator" );
766
    String name = new String(Release);
807
    String name = new String(Release);
767
    name += fs + mName + fs + mVersion + mExtension;
808
    name += fs + mName + fs + mVersion + mExtension;
768
    File release = new File(name);
809
    File release = new File(name);