Subject: bug#61914: IceCat does not start with en_GB.utf8 locale

From: Maxim Cournoyer <[email-masked]>
Date: Fri, 03 Mar 2023 10:44:30 -0500

Hi,

Maxim Cournoyer <[email-masked]> writes:

[...]

> Browsing about:config, I see:
>
> extensions.systemAddon.update.enabled	false
>
> I wonder if this could make a different to be set to true instead.  It's
> set to false by the makeicecat.sh script we run to transform the Firefox
> source into GNU IceCat.  I guess we'll have to look at the source for
> more clues as to how language pack updates are handled exactly.

I have the same problem, where the French language pack I used with a
previous version of IceCat (102.7.0) is not updating to the
system-provided one.  Setting 'extensions.systemAddon.update.enabled' to
'true' does not help.

I've now reported the issue upstream:
https://bugzilla.mozilla.org/show_bug.cgi?id=1820196.

I've also taken a peek at the source, and it seems the update/cache of
language pack modules would be handled in the
toolkit/mozapps/extensions/internal/XPIDatabase.jsm, e.g. in
processFileChanges and updateExistingAddon.  It seems the cache should
be invalidated in our situation, based on the comment and logic:

--8<---------------cut here---------------start------------->8---
  /**
   * Updates the databse metadata for an existing add-on during database
   * reconciliation.
   *
   * @param {AddonInternal} oldAddon
   *        The existing database add-on entry.
   * @param {XPIState} xpiState
   *        The XPIStates entry for this add-on.
   * @param {AddonInternal?} newAddon
   *        The new add-on metadata for the add-on, as loaded from a
   *        staged update in addonStartup.json.
   * @param {boolean} aUpdateCompatibility
   *        true to update add-ons appDisabled property when the application
   *        version has changed
   * @param {boolean} aSchemaChange
   *        The schema has changed and all add-on manifests should be re-read.
   * @returns {AddonInternal?}
   *        The updated AddonInternal object for the add-on, if one
   *        could be created.
   */
  updateExistingAddon(
    oldAddon,
    xpiState,
    newAddon,
    aUpdateCompatibility,
    aSchemaChange
  ) {
    XPIDatabase.recordAddonTelemetry(oldAddon);

    let installLocation = oldAddon.location;

    // Update the add-on's database metadata from on-disk metadata if:
    //
    //  a) The add-on was staged for install in the last session,
    //  b) The add-on has been modified since the last session, or,
    //  c) The app has been updated since the last session, and the
    //     add-on is part of the application bundle (and has therefore
    //     likely been replaced in the update process).
    if (
      newAddon ||
      oldAddon.updateDate != xpiState.mtime ||
      (aUpdateCompatibility && this.isAppBundledLocation(installLocation))
    ) {
      newAddon = this.updateMetadata(
        installLocation,
        oldAddon,
        xpiState,
        newAddon
      );
    } else if (oldAddon.path != xpiState.path) {
      newAddon = this.updatePath(installLocation, oldAddon, xpiState);
    } else if (aUpdateCompatibility || aSchemaChange) {
      newAddon = this.updateCompatibility(
        installLocation,
        oldAddon,
        xpiState,
        aSchemaChange
      );
    } else {
      newAddon = oldAddon;
    }

    if (newAddon) {
      newAddon.rootURI = newAddon.rootURI || xpiState.rootURI;
    }

    return newAddon;
  },
--8<---------------cut here---------------end--------------->8---

To be continued...

-- 
Thanks,
Maxim