| 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 Framework | Assignee: | Port Management Team <portmgr> |
| Status: | New --- | ||
| Severity: | Affects Only Me | CC: | jamie, ports-bugs |
| Priority: | --- | ||
| Version: | Latest | ||
| Hardware: | Any | ||
| OS: | Any | ||
(In reply to Jamie Landeg-Jones from comment #0) ... /var/cache/ports/.index/ maybe a better choice! Problem still exists. |
"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)