Verified Commit 022390f3 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

fixup! Bug 41668: Tweaks to the Base Browser updater for Tor Browser

Bug 41776: Keep shipping the old fontconfig file until users have one
parent 2e7c5d6d
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -104,6 +104,28 @@ make_add_if_not_instruction() {
  echo "add-if-not \"$f\" \"$f\"" >> "$filev3"
}

check_for_add_if_update() {
  add_if_file_chk="$1"

  # tor-browser#41776: We will remove with the old fontconfig file manually
  # outside the update process. So, let the updater add the file if there.
  # TODO: Remove once we do a watershed release.
  if [ "$add_if_file_chk" = "TorBrowser/Data/fontconfig/fonts.conf" ]; then
    ## "true" *giggle*
    return 0;
  fi
  ## 'false'... because this is bash. Oh yay!
  return 1;
}

make_add_if_instruction() {
  f="$1"
  filev3="$2"

  verbose_notice " add-if \"$f\" \"$f\""
  echo "add-if \"$f\" \"$f\"" >> "$filev3"
}

make_patch_instruction() {
  f="$1"
  filev3="$2"
+3 −0
Original line number Diff line number Diff line
@@ -105,6 +105,9 @@ for ((i=0; $i<$num_files; i=$i+1)); do

  if check_for_add_if_not_update "$f"; then
    make_add_if_not_instruction "$f" "$updatemanifestv3"
  elif check_for_add_if_update "$f"; then
    # TODO: Remove once we do a watershed release
    make_add_if_instruction "$f" "$updatemanifestv3"
  else
    make_add_instruction "$f" "$updatemanifestv3"
  fi
+10 −0
Original line number Diff line number Diff line
@@ -212,6 +212,13 @@ for ((i=0; $i<$num_oldfiles; i=$i+1)); do
      continue 1
    fi

    if check_for_add_if_update "$f"; then
      # TODO: Remove once we do a watershed release
      make_add_if_instruction "$f" "$updatemanifestv3"
      archivefiles="$archivefiles \"$f\""
      continue 1
    fi

    if check_for_forced_update "$requested_forced_updates" "$f"; then
      # The full workdir may not exist yet, so create it if necessary.
      mkdir -p `dirname "$workdir/$f"`
@@ -303,6 +310,9 @@ for ((i=0; $i<$num_newfiles; i=$i+1)); do

  if check_for_add_if_not_update "$f"; then
    make_add_if_not_instruction "$f" "$updatemanifestv3"
  elif check_for_add_if_update "$f"; then
    # TODO: Remove once we do a watershed release
    make_add_if_instruction "$f" "$updatemanifestv3"
  else
    make_add_instruction "$f" "$updatemanifestv3"
  fi