From 22886d8799de194a3da7d5f41653fc50fea34ef7 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 22 May 2026 21:52:25 +0200 Subject: [PATCH] phase-M task M49: sourceforge files-dir parent fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The derived SourceForge tag URL is .../files/, but some projects host releases directly under .../files/ (no per-project subdir) — e.g. nicstat, tclap — so the sub-dir 404s and C emitted empty. Added a parent fallback in the sf branch: when the primary fetch fails or returns no names, retry .../files/. Only fires on primary failure, so working sf specs (expect -> /files/Expect, cscope -> bogus-but-PS-matching empty) are untouched. Verified locally: nicstat + tclap now "(same version)" = PS; expect/cscope unchanged. FRD: FRD-011 ADR: ADR-0001 PS-source: photonos-package-report.ps1 L 3460-3475 Parity: strict Co-Authored-By: Claude Opus 4.7 --- .../photonos-package-report/src/check_urlhealth.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/photonos-package-report/photonos-package-report/src/check_urlhealth.c b/photonos-package-report/photonos-package-report/src/check_urlhealth.c index dd4f50f4..13114f41 100644 --- a/photonos-package-report/photonos-package-report/src/check_urlhealth.c +++ b/photonos-package-report/photonos-package-report/src/check_urlhealth.c @@ -1446,6 +1446,18 @@ char *check_urlhealth(pr_task_t *task, char *sf_url = pr_sourceforge_tag_url(task->Spec, state.Source0); if (sf_url) { scrape_ok = (pr_sourceforge_fetch_names(sf_url, &names, &n) == 0); + /* M49: the derived URL is .../files/, but some + * projects host releases directly under .../files/ (e.g. + * nicstat, tclap). If the sub-dir 404s / yields + * nothing, retry the parent .../files/. Only fires when + * the primary fails, so working specs are untouched. */ + if (!scrape_ok || n == 0) { + char *slash = strrchr(sf_url, '/'); + if (slash && slash != sf_url) { + slash[1] = '\0'; /* keep trailing slash */ + scrape_ok = (pr_sourceforge_fetch_names(sf_url, &names, &n) == 0); + } + } used_sf = 1; free(sf_url); }