Bug 264655

Summary: make in possible to wrap FETCH_BINARY
Product: Ports & Packages Reporter: Eugene Grosbein <eugen>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: New ---    
Severity: Affects Only Me CC: dmgk, ports-bugs
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Eugene Grosbein freebsd_committer freebsd_triage 2022-06-13 12:00:27 UTC
I'm struggling to create some wrapper for FETCH_BINARY that is capable to extract target archive file name from some complex URL and pass it to original FETCH_BINARY with additional "-o $filename" arguments.

My attempt is to put the following to some port's Makefile:

FETCH_BINARY:=  /bin/sh ${FILESDIR}/fetchit ${FETCH_BINARY}

This only works if I put it after ".include <bsd.port.mk>" that violate Porter's Handbook instructions.

It does not work if I put it after .include <bsd.port.pre.mk>
Please make it work.
Comment 1 Dmitri Goutnik freebsd_committer freebsd_triage 2022-06-13 13:40:17 UTC
Another option might be setting FETCH_CMD instead:

FETCH_CMD=  /bin/sh ${FILESDIR}/fetchit ${FETCH_BINARY} ${FETCH_ARGS}
Comment 2 Baptiste Daroussin freebsd_committer freebsd_triage 2022-08-26 08:27:47 UTC
Does the FETCH_CMD solution work for you ?
Comment 3 Eugene Grosbein freebsd_committer freebsd_triage 2022-08-26 09:31:13 UTC
(In reply to Baptiste Daroussin from comment #2)

So some extent, not in full, because of FETCH_BEFORE_ARGS and FETCH_AFTER_ARGS that cannot be supported via FETCH_CMD.