morgan pushed to branch maint-14.0 at The Tor Project / Applications / tor-browser-build

Commits:

1 changed file:

Changes:

  • tools/relprep.py
    ... ... @@ -306,6 +306,7 @@ class ReleasePreparation:
    306 306
             self.save_config("browser", config)
    
    307 307
     
    
    308 308
         def update_addon_amo(self, config, name, addon_id):
    
    309
    +        logger.debug("Checking updates for %s", name)
    
    309 310
             r = requests.get(
    
    310 311
                 f"https://services.addons.mozilla.org/api/v4/addons/addon/{addon_id}"
    
    311 312
             )
    
    ... ... @@ -318,6 +319,7 @@ class ReleasePreparation:
    318 319
             addon_input["sha256sum"] = addon["hash"][7:]
    
    319 320
     
    
    320 321
         def update_mullvad_addon(self, config):
    
    322
    +        logger.debug("Checking updates for the Mullvad addon")
    
    321 323
             input_ = self.find_input(config, "mullvad-extension")
    
    322 324
             r = requests.get(
    
    323 325
                 "https://cdn.mullvad.net/browser-extension/updates.json"
    
    ... ... @@ -336,11 +338,11 @@ class ReleasePreparation:
    336 338
     
    
    337 339
             path = self.base_path / "out/browser" / url.split("/")[-1]
    
    338 340
             # The extension should be small enough to easily fit in memory :)
    
    339
    -        if not path.exists:
    
    341
    +        if not path.exists():
    
    340 342
                 r = requests.get(url)
    
    341 343
                 r.raise_for_status()
    
    342 344
                 with path.open("wb") as f:
    
    343
    -                f.write(r.bytes)
    
    345
    +                f.write(r.content)
    
    344 346
             with path.open("rb") as f:
    
    345 347
                 input_["sha256sum"] = sha256(f.read()).hexdigest()
    
    346 348
             logger.debug("Mullvad extension downloaded and updated")
    
    ... ... @@ -546,14 +548,9 @@ class ReleasePreparation:
    546 548
             changelogs = cb.create(**kwargs)
    
    547 549
     
    
    548 550
             path = f"projects/browser/Bundle-Data/Docs-{tag_prefix.upper()}/ChangeLog.txt"
    
    549
    -        stable_tag = self.last_releases[(tag_prefix, "release")][0].tag
    
    550
    -        alpha_tag = self.last_releases[(tag_prefix, "alpha")][0].tag
    
    551
    -        if stable_tag.tagged_date > alpha_tag.tagged_date:
    
    552
    -            last_tag = stable_tag
    
    553
    -        else:
    
    554
    -            last_tag = alpha_tag
    
    555
    -        logger.debug("Using %s to add the new changelogs to.", last_tag.tag)
    
    556
    -        last_changelogs = self.repo.git.show(f"{last_tag.tag}:{path}")
    
    551
    +        # Take HEAD to reset any changes we might already have from a
    
    552
    +        # previous run.
    
    553
    +        last_changelogs = self.repo.git.show(f"HEAD:{path}")
    
    557 554
             with (self.base_path / path).open("w") as f:
    
    558 555
                 f.write(changelogs + "\n" + last_changelogs + "\n")
    
    559 556