brizental pushed to branch tor-browser-140.2.0esr-15.0-1 at The Tor Project / Applications / Tor Browser

Commits:

1 changed file:

Changes:

  • python/mozbuild/mozbuild/backend/base.py
    ... ... @@ -246,7 +246,7 @@ class BuildBackend(LoggingMixin):
    246 246
             app = config.substs["MOZ_BUILD_APP"]
    
    247 247
     
    
    248 248
             noscript_target_filename = "{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi"
    
    249
    -        noscript_location = Path(config.substs["NOSCRIPT"])
    
    249
    +        noscript_location = config.substs.get("NOSCRIPT")
    
    250 250
     
    
    251 251
             def _infallible_symlink(src, dst):
    
    252 252
                 try:
    
    ... ... @@ -280,30 +280,30 @@ class BuildBackend(LoggingMixin):
    280 280
                         "fonts": tbdir / "fonts",
    
    281 281
                     }
    
    282 282
     
    
    283
    -            fonts_location = Path(config.substs["TOR_BROWSER_FONTS"])
    
    284
    -            if fonts_location.is_dir():
    
    283
    +            fonts_location = config.substs.get("TOR_BROWSER_FONTS")
    
    284
    +            if fonts_location:
    
    285 285
                     self.log(
    
    286 286
                         logging.INFO,
    
    287 287
                         "_setup_tor_browser_environment",
    
    288 288
                         {
    
    289
    -                        "fonts_location": str(fonts_location),
    
    289
    +                        "fonts_location": fonts_location,
    
    290 290
                             "fonts_target": str(paths["fonts"]),
    
    291 291
                         },
    
    292 292
                         "Creating symlink for fonts files from {fonts_location} to {fonts_target}",
    
    293 293
                     )
    
    294 294
     
    
    295
    -                for file in fonts_location.iterdir():
    
    295
    +                for file in Path(fonts_location).iterdir():
    
    296 296
                         target = paths["fonts"] / file.name
    
    297 297
                         _infallible_symlink(file, target)
    
    298 298
     
    
    299 299
                 # Set up NoScript extension
    
    300
    -            if noscript_location.is_file():
    
    300
    +            if noscript_location:
    
    301 301
                     noscript_target = paths["exts"] / noscript_target_filename
    
    302 302
                     self.log(
    
    303 303
                         logging.INFO,
    
    304 304
                         "_setup_tor_browser_environment",
    
    305 305
                         {
    
    306
    -                        "noscript_location": str(noscript_location),
    
    306
    +                        "noscript_location": noscript_location,
    
    307 307
                             "noscript_target": str(noscript_target),
    
    308 308
                         },
    
    309 309
                         "Creating symlink for NoScript from {noscript_location} to {noscript_target}",
    
    ... ... @@ -312,8 +312,12 @@ class BuildBackend(LoggingMixin):
    312 312
                     paths["exts"].mkdir(parents=True, exist_ok=True)
    
    313 313
                     _infallible_symlink(noscript_location, noscript_target)
    
    314 314
     
    
    315
    -            expert_bundle_location = Path(config.substs["TOR_EXPERT_BUNDLE"])
    
    316
    -            if expert_bundle_location.is_dir():
    
    315
    +            expert_bundle_location = config.substs.get("TOR_EXPERT_BUNDLE")
    
    316
    +            if expert_bundle_location:
    
    317
    +                expert_bundle_location = Path(expert_bundle_location)
    
    318
    +                if not expert_bundle_location.is_dir():
    
    319
    +                    return
    
    320
    +
    
    317 321
                     self.log(
    
    318 322
                         logging.INFO,
    
    319 323
                         "_setup_tor_browser_environment",
    
    ... ... @@ -353,9 +357,10 @@ class BuildBackend(LoggingMixin):
    353 357
                             _infallible_symlink(file, target)
    
    354 358
     
    
    355 359
                     # Setup Tor binary
    
    356
    -                for item in (expert_bundle_location / "tor").iterdir():
    
    360
    +                for item in Path(expert_bundle_location / "tor").iterdir():
    
    357 361
                         target = paths["tor_bin"] / item.name
    
    358
    -                    if target.is_file():
    
    362
    +
    
    363
    +                    if item.is_file():
    
    359 364
                             _infallible_symlink(item, target)
    
    360 365
     
    
    361 366
                     # Set up licenses