[Bug 270708] makesum broken for MASTER_SITE_OSDN

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 08 Apr 2023 17:56:50 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270708

            Bug ID: 270708
           Summary: makesum broken for MASTER_SITE_OSDN
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Ports Framework
          Assignee: portmgr@FreeBSD.org
          Reporter: naddy@FreeBSD.org
                CC: ports-bugs@FreeBSD.org

The "makesum" target fails to work correctly for MASTER_SITE_OSDN.

OSDN interposes an HTML page for downloads unless it recognizes the client as
wget, curl, or such.  fetch(1) is not recognized.  To circumvent that,
bsd.sites.mk has this:

.if !empty(MASTER_SITES:M*OSDN*) || !empty(PATCH_SITES:M*OSDN*)
FETCH_ARGS+=    --user-agent=curl/7.68.0
.endif

Unfortunately, when "makesum" in bsd.port.mk recursively calls "fetch",
MASTER_SITES has already been expanded and the above .if is skipped, which
means FETCH_ARGS isn't modified, which means the download gets the HTML page
instead of the distfile.

As an example port, you an use shells/yash.

$ make distclean
$ make checksum
# ok
$ make distclean
$ make makesum
# distinfo is changed and the new distfile is an HTML page

-- 
You are receiving this mail because:
You are on the CC list for the bug.