ElasticWolf.app/Contents/Frameworks/XUL.framework/Versions/13.0/components/nsUpdateService.js
/**
   * Determine the update from the specified updates that should be offered.
   * If both valid major and minor updates are available the minor update will
   * be offered.
   * @param   updates
   *          An array of available nsIUpdate items
   * @return  The nsIUpdate to offer.
   */
Determine the update from the specified updates that should be offered.
If both valid major and minor updates are available the minor update will
be offered.
@param   updates
An array of available nsIUpdate items
@return  The nsIUpdate to offer.
Determine the update from the specified updates that should be offered . If both valid major and minor updates are available the minor update will be offered . @param updates An array of available nsIUpdate items @return The nsIUpdate to offer .
function AUS_selectUpdate(updates) {
    if (updates.length == 0)
      return null;
    var majorUpdate = null;
    var minorUpdate = null;
    var vc = Services.vc;
    updates.forEach(function(aUpdate) {
      if (vc.compare(aUpdate.appVersion, Services.appinfo.version) < 0 ||
          vc.compare(aUpdate.appVersion, Services.appinfo.version) == 0 &&
          aUpdate.buildID == Services.appinfo.appBuildID) {
        LOG("UpdateService:selectUpdate - skipping update because the " +
            "update's application version is less than the current " +
            "application version");
        return;
      }
      let neverPrefName = PREF_APP_UPDATE_NEVER_BRANCH + aUpdate.appVersion;
      if (aUpdate.showNeverForVersion &&
          getPref("getBoolPref", neverPrefName, false)) {
        LOG("UpdateService:selectUpdate - skipping update because the " +
            "preference " + neverPrefName + " is true");
        return;
      }
      switch (aUpdate.type) {
        case "major":
          if (!majorUpdate)
            majorUpdate = aUpdate;
          else if (vc.compare(majorUpdate.appVersion, aUpdate.appVersion) <= 0)
            majorUpdate = aUpdate;
          break;
        case "minor":
          if (!minorUpdate)
            minorUpdate = aUpdate;
          else if (vc.compare(minorUpdate.appVersion, aUpdate.appVersion) <= 0)
            minorUpdate = aUpdate;
          break;
        default:
          LOG("UpdateService:selectUpdate - skipping unknown update type: " +
              aUpdate.type);
          break;
      }
    });
    return minorUpdate || majorUpdate;
  }
function AUS_selectUpdate ( updates ) { if ( updates . length == 0 ) return null ; var majorUpdate = null ; var minorUpdate = null ; var vc = Services . vc ; updates . forEach ( function ( aUpdate ) { if ( vc . compare ( aUpdate . appVersion , Services . appinfo . version ) < 0 || vc . compare ( aUpdate . appVersion , Services . appinfo . version ) == 0 && aUpdate . buildID == Services . appinfo . appBuildID ) { LOG ( "UpdateService:selectUpdate - skipping update because the " + "update's application version is less than the current " + "application version" ) ; return ; } let neverPrefName = PREF_APP_UPDATE_NEVER_BRANCH + aUpdate . appVersion ; if ( aUpdate . showNeverForVersion && getPref ( "getBoolPref" , neverPrefName , false ) ) { LOG ( "UpdateService:selectUpdate - skipping update because the " + "preference " + neverPrefName + " is true" ) ; return ; } switch ( aUpdate . type ) { case "major" : if ( ! majorUpdate ) majorUpdate = aUpdate ; else if ( vc . compare ( majorUpdate . appVersion , aUpdate . appVersion ) <= 0 ) majorUpdate = aUpdate ; break ; case "minor" : if ( ! minorUpdate ) minorUpdate = aUpdate ; else if ( vc . compare ( minorUpdate . appVersion , aUpdate . appVersion ) <= 0 ) minorUpdate = aUpdate ; break ; default : LOG ( "UpdateService:selectUpdate - skipping unknown update type: " + aUpdate . type ) ; break ; } } ) ; return minorUpdate || majorUpdate ; }
Determine the update from the specified updates that should be offered.
Determine the update from the specified updates that should be offered .
// Choose the newest of the available minor and major updates. // Ignore updates for older versions of the application and updates for // the same version of the application with the same build ID. // Skip the update if the user responded with "never" to this update's // application version and the update specifies showNeverForVersion // (see bug 350636).