Bug 202070

Summary: 'make index' removes INDEX before building INDEX
Product: Ports & Packages Reporter: Jashank Jeremy <freebsd>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: Closed FIXED    
Severity: Affects Many People CC: adamw, koobs, kwm, portmgr, ports-bugs, w.schwarzenfeld
Priority: --- Keywords: needs-qa
Version: LatestFlags: koobs: maintainer-feedback? (portmgr)
koobs: merge-quarterly?
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Proposed patch
none
patch-usr_ports-Makefile
none
svn-diff-usr_ports_Makefile_v2 none

Description Jashank Jeremy 2015-08-04 03:17:06 UTC
Overview:

    'make index' removes INDEX before building INDEX

Steps to Reproduce:

    1) Run a 'make index'.

    2) Interrupt it.

Actual Results:

    INDEX file gone.

Expected Results: 

    INDEX file should only be replaced at the point where there's a
    new INDEX to replace it; essentially, build INDEX.tmp, then swap
    it in.
Comment 1 Jashank Jeremy 2015-08-04 03:17:49 UTC
Created attachment 159515 [details]
Proposed patch
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2015-08-04 04:29:28 UTC
Pending creation of phabricator review
Comment 3 Jashank Jeremy 2015-08-04 07:42:41 UTC
Differential Revision: https://reviews.freebsd.org/D3298
Comment 4 Walter Schwarzenfeld freebsd_triage 2019-09-06 13:41:40 UTC
ping! I think it is a good idea.
Comment 5 Walter Schwarzenfeld freebsd_triage 2019-09-06 13:42:14 UTC
Patch should updated, line numbers had changed.
Comment 6 Walter Schwarzenfeld freebsd_triage 2019-09-06 14:45:52 UTC
Created attachment 207239 [details]
patch-usr_ports-Makefile

Update patch.
Comment 7 Walter Schwarzenfeld freebsd_triage 2019-09-06 14:53:11 UTC
Created attachment 207240 [details]
svn-diff-usr_ports_Makefile_v2

Forgot remove one line.
Comment 8 Adam Weinberger freebsd_committer freebsd_triage 2019-11-24 21:15:00 UTC
What's the status here?

Very frequently, `make fetchindex` retrieves a partial INDEX. Looking at my logs, 18% of my fetchindex runs were aborted due to a truncated INDEX-12.bz2. If this patch will resolve that (will it?), I'm in favor of it.
Comment 9 commit-hook freebsd_committer freebsd_triage 2021-11-08 13:00:09 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=62f3ada9497ac74c9fe7fe8e4207eebd43af0989

commit 62f3ada9497ac74c9fe7fe8e4207eebd43af0989
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2021-11-08 12:51:02 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2021-11-08 12:58:22 +0000

    index: keep index file as long as possible

    When generating the INDEX file, we are already building it in a
    temporary file and swap it last minute. make the index target now
    directly depend on the INDEX file generation target.
    Turn that target into a PHONY target so the file is always regenerated
    when someone calls make index.

    PR:             202070

 Makefile | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)