Bug 269040

Summary: ports framework: make fetchindex downloads the index even if there are no changes to local copy
Product: Ports & Packages Reporter: Jamie Landeg-Jones <jamie>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: New ---    
Severity: Affects Only Me CC: jamie, ports-bugs
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Jamie Landeg-Jones 2023-01-18 23:37:37 UTC
"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)
Comment 1 Jamie Landeg-Jones 2023-01-18 23:43:36 UTC
(In reply to Jamie Landeg-Jones from comment #0)

... /var/cache/ports/.index/  maybe a better choice!
Comment 2 Jamie Landeg-Jones 2023-07-10 14:54:39 UTC
Problem still exists.