Bug 270708 - makesum broken for MASTER_SITE_OSDN
Summary: makesum broken for MASTER_SITE_OSDN
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-08 17:56 UTC by Christian Weisgerber
Modified: 2023-04-08 18:07 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Weisgerber freebsd_committer freebsd_triage 2023-04-08 17:56:50 UTC
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