[www-doc] [Git][VideoLAN.org/websites][master] 2 commits: Makefile: keep building when a page or a folder fails

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Thu Nov 12 08:23:28 UTC 2026



Jean-Baptiste Kempf pushed to branch master at VideoLAN organization / websites


Commits:
c3d97d50 by Martin Finkel at 2026-11-12T11:05:57+07:00
Makefile: keep building when a page or a folder fails

A failing page used to stop the whole build: make stopped at the first
error in a folder, and the recursion exited at the first failing folder.
When vlc/stats/downloads.php cannot reach Mirrorbits, every folder after
it (videolan, projects, developers, press, vlmc) was left unbuilt, which
is how pages on www.videolan.org ended up stale since 2026-09-22.

Build with --keep-going and finish the recursion before reporting the
failure. Make still exits with an error, and a failed page keeps its
previous version.

- - - - -
0ebdf47f by Martin Finkel at 2026-11-12T11:05:57+07:00
stats: fix the Mirrorbits fallback, fail on bad answers

fetch_fallback() used an undefined $json_url instead of its $url
argument, so it always failed when the curl extension is missing.

An answer that is not a JSON object with an integer Total counted as
0 downloads, so the page published totals that were too low. Throw
instead: the page fails and keeps its previous version.

- - - - -


2 changed files:

- www.videolan.org/Makefile
- www.videolan.org/vlc/stats/downloads.php


Changes:

=====================================
www.videolan.org/Makefile
=====================================
@@ -11,6 +11,8 @@ else
   NEXTROOT := ../$(ROOT)
 endif
 
+MAKEFLAGS += --keep-going
+
 PHPCGI := $(ROOT)bin/php-cgi.sh
 STRIP_HEADERS := $(ROOT)bin/strip-headers.sh
 
@@ -45,10 +47,12 @@ clean: clean-recursive
 	rm -rf $(ROOT)images/og
 
 %-recursive:
-	@for d in $(SUBDIR) ; do \
+	@failed=0 ; \
+	for d in $(SUBDIR) ; do \
 		$(MAKE) -f $(NEXTROOT)Makefile -C $$d ROOT=$(NEXTROOT) $* \
-			HERE=$(HERE)$$d/ || exit $$? ; \
-	done
+			HERE=$(HERE)$$d/ || failed=$$? ; \
+	done ; \
+	exit $$failed
 
 %.html: %.php $(ROOT)Makefile $(ROOT)/include/*.php 
 	@echo "Preprocessing $@ ..."


=====================================
www.videolan.org/vlc/stats/downloads.php
=====================================
@@ -46,9 +46,9 @@
                'timeout' => 5,
            ),
         ));
-       $body = file_get_contents($json_url, false, $ctx);
+       $body = file_get_contents($url, false, $ctx);
        if ($body === false) {
-           throw new Exception('Unable to fetch ' . $json_url);
+           throw new Exception('Unable to fetch ' . $url);
        }
        return $body;
     }
@@ -82,14 +82,10 @@
        }
 
        $json = json_decode($json_file);
-       if (is_int($json->Total))
-       {
-               return $json->Total;
-       }
-       else
-       {
-               return 0;
+       if (!is_object($json) || !isset($json->Total) || !is_int($json->Total)) {
+           throw new Exception('Unexpected answer from ' . $json_url);
        }
+       return $json->Total;
     }
 
     $wintotal = 0;



View it on GitLab: https://code.videolan.org/VideoLAN.org/websites/-/compare/bc552bd13c89c75a617d4bea4e0f25b44675e8e2...0ebdf47f244fd52818d05bd10b4bd47172cc20f0

-- 
View it on GitLab: https://code.videolan.org/VideoLAN.org/websites/-/compare/bc552bd13c89c75a617d4bea4e0f25b44675e8e2...0ebdf47f244fd52818d05bd10b4bd47172cc20f0
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the www-doc mailing list