Page MenuHomeFreeBSD

Mk/Scripts/do-fetch.sh: read distfiles from stdin to avoid ARG_MAX
Needs ReviewPublic

Authored by bapt on Mon, Sep 7, 8:06 AM.
Tags
None
Referenced Files
F170894656: D59475.diff
Mon, Sep 7, 9:35 AM
F170894618: D59475.id186110.diff
Mon, Sep 7, 9:34 AM
F170891528: D59475.id186110.diff
Mon, Sep 7, 8:54 AM
F170890429: D59475.diff
Mon, Sep 7, 8:42 AM
F170887596: D59475.diff
Mon, Sep 7, 8:06 AM
Subscribers
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Pass the list of files to fetch to do-fetch.sh through stdin instead of
command-line arguments.

PR: 295029

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 76624
Build 73507: arc lint + arc unit

Event Timeline

bapt requested review of this revision.Mon, Sep 7, 8:06 AM
bapt created this revision.

I'm not sure this would fix the command line length, it it just moves the length around.
I've been thinking of a real fix for this, and I think it needs to put it all in a temporary file, kinda

.   for d in ${DISTFILES}
     printf "%s\n" "$d" >> temp
.   endfor

and then pass maybe either pass the tempfile name to do-fetch, or use it as its stdin.

Also, there is the same problem for each script that we pass the distfiles to, like makesum.

Maybe using \0 instead of \n is better there, and juggling with IFS to split on \0, in case some distfile has a strange file name.

yesh I pondered the tempfile, but this was longer, actually, but yes I think you are right, as printf will complain also about the ARG_MAX.