Summary: | `make fetchindex' may leave a corrupt INDEX file | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Wolfram Schneider <wosch> | ||||
Component: | Ports Framework | Assignee: | Port Management Team <portmgr> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | dch, portmgr, ports-bugs, rene | ||||
Priority: | --- | ||||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
URL: | https://reviews.freebsd.org/D14088 | ||||||
Bug Depends on: | 224893 | ||||||
Bug Blocks: | |||||||
Attachments: |
|
Description
Wolfram Schneider
![]() ![]() Another issue is: the fetch command runs in mirror mode (-am), but the INDEX.bz2 file will be deleted after extracted. That does not make sense. make -n fetchindex /usr/bin/env fetch -am -o /home/projects/freebsd-ports/INDEX-12.bz2 http://www.FreeBSD.org/ports/INDEX-12.bz2 bunzip2 < /home/projects/freebsd-ports/INDEX-12.bz2 > /home/projects/freebsd-ports/INDEX-12 && chmod a+r /home/projects/freebsd-ports/INDEX-12 && /bin/rm -f /home/projects/freebsd-ports/INDEX-12.bz2 To run fetch(1) in mirror mode, we need to keep the bzip2'd INDEX file. Created attachment 189374 [details]
/usr/ports/Makefile patch
Reassign to portmgr A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=cd8518854f3e96fb86dd7ed7b8f1c0258e839157 commit cd8518854f3e96fb86dd7ed7b8f1c0258e839157 Author: Baptiste Daroussin <bapt@FreeBSD.org> AuthorDate: 2021-11-08 14:58:02 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2021-11-08 14:59:55 +0000 fetchindex: do not leave a corrupted INDEX When extracting the fetched index, do it in a temporary file, and only when extraction succeed, move it to the final file, it makes it more atomic and less likely to live a corrupted file behind PR: 224871 Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) |