@@ -513,7 +513,7 @@ def build_robots_txt(www_root: Path, group, skip_cache_invalidation):
513
513
requests .request ("PURGE" , "https://docs.python.org/robots.txt" )
514
514
515
515
516
- def build_sitemap (www_root : Path ):
516
+ def build_sitemap (www_root : Path , group ):
517
517
"""Build a sitemap with all live versions and translations."""
518
518
if not www_root .exists ():
519
519
logging .info ("Skipping sitemap generation (www root does not even exists)." )
@@ -524,14 +524,19 @@ def build_sitemap(www_root: Path):
524
524
sitemap_file .write (
525
525
template .render (languages = LANGUAGES , versions = VERSIONS ) + "\n "
526
526
)
527
+ sitemap_file .chmod (0o775 )
528
+ run (["chgrp" , group , sitemap_file ])
527
529
528
530
529
- def build_404 (www_root : Path ):
531
+ def build_404 (www_root : Path , group ):
530
532
"""Build a nice 404 error page to display in case PDFs are not built yet."""
531
533
if not www_root .exists ():
532
534
logging .info ("Skipping 404 page generation (www root does not even exists)." )
533
535
return
534
- shutil .copyfile (HERE / "templates" / "404.html" , www_root / "404.html" )
536
+ not_found_file = www_root / "404.html"
537
+ shutil .copyfile (HERE / "templates" / "404.html" , not_found_file )
538
+ not_found_file .chmod (0o775 )
539
+ run (["chgrp" , group , not_found_file ])
535
540
536
541
537
542
def head (text , lines = 10 ):
0 commit comments