[Bug 269432] ports: FETCH_ARGS / FETCH_CMD can't accept a string with spaces

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 09 Feb 2023 06:59:17 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269432

            Bug ID: 269432
           Summary: ports: FETCH_ARGS / FETCH_CMD can't accept a string
                    with spaces
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: pat@patmaddox.com

Created attachment 240020
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=240020&action=edit
fix for string with spaces in FETCH_ARGS

Context: I am writing a port that fetches from a private GitHub repository, to
be built on our company's internal poudriere system. It's possible to download
zips from private repos by passing header e.g. "Authorization: token
<some-token-here>".

/usr/bin/fetch doesn't support HTTP headers as far as I can tell, so I am using
curl.

https://github.com/freebsd/freebsd-ports/blob/main/Mk/Scripts/do-fetch.sh#L151
currently expands the FETCH_BINARY / FETCH_ARGS etc combo in a way that
prevents it from working. Specifically, it turns the string "foo bar" into
'"foo' 'bar"'.

I have attached a one-line diff that fixes it. I have built 600+ packages using
poudriere with this fix in place.

-- 
You are receiving this mail because:
You are the assignee for the bug.