[Bug 269040] ports framework: make fetchindex downloads the index even if there are no changes to local copy

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 18 Jan 2023 23:37:37 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269040

            Bug ID: 269040
           Summary: ports framework: make fetchindex downloads the index
                    even if there are no changes to local copy
           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: jamie@catflap.org

"make fetchindex" uses "fetch" with the "-m" switch, so that if there are no
changes to the index file, then it won't download it again.

Unfortunately, /usr/ports/Makefile contains:

[code]
fetchindex: ${INDEXDIR}/${INDEXFILE}.${INDEX_COMPRESSION_FORMAT}
        @if bsdcat < ${INDEXDIR}/${INDEXFILE}.${INDEX_COMPRESSION_FORMAT} >
${INDEXDIR}/${INDEXFILE}.tmp ; then \
                chmod a+r ${INDEXDIR}/${INDEXFILE}.tmp; \
                ${MV} ${INDEXDIR}/${INDEXFILE}.tmp ${INDEXDIR}/${INDEXFILE}; \
                ${RM} ${INDEXDIR}/${INDEXFILE}.${INDEX_COMPRESSION_FORMAT} \
        else ; \
                ${RM} ${INDEXDIR}/${INDEXFILE}.tmp ; \
        fi
[/code]

The downloaded file is INDEX-XX.xz - a compressed file. This is uncompressed
and then deleted, so subsequent fetches have nothing to compare old against
new.

It's probably best to not delete the compressed file (maybe download and keep
it outside the main tree to keep it from cluttering it up (e.g.
/usr/ports/.cache/index-XX.xz)

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