New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #16234 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

portindex should be atomic

Reported by: ryandesign@… Owned by: ryandesign@…
Priority: Normal Milestone: MacPorts 1.7.0
Component: base Version: 1.7.0
Keywords: Cc:
Port:

Description

The portindex script should work atomically -- it should replace the old PortIndex file with the new one in a single step. Currently portindex clears the PortIndex and starts rebuilding it. This means that while the portindex script is running, you really can't use MacPorts (for example to install other ports) because the PortIndex is incomplete until the script finishes. portindex should rebuild the PortIndex in a temporary file, and only move the temporary file over the real PortIndex once it's completely done.

I initially brought this up on macports-dev.

Attachments

portindex.tcl.diff (579 bytes) - added by blb@… 5 years ago.
diff to base/src/port/portindex.tcl

Change History

Changed 5 years ago by blb@…

diff to base/src/port/portindex.tcl

comment:1 Changed 5 years ago by blb@…

Simple patch attached; rename the PortIndex.regen if a better name (or safe temp-naming) is desired.

comment:2 Changed 5 years ago by ryandesign@…

  • Milestone changed from MacPorts base bugs to MacPorts 1.7.0

comment:3 Changed 5 years ago by ryandesign@…

Let's use mktemp to make the temporary file in the tmp directory.

comment:4 Changed 5 years ago by ryandesign@…

  • Owner changed from macports-tickets@… to ryandesign@…
  • Status changed from new to assigned

comment:5 Changed 5 years ago by ryandesign@…

Fixed in r41701.

comment:6 Changed 5 years ago by ryandesign@…

  • Status changed from assigned to closed
  • Resolution set to fixed

Updated ChangeLog in r41702.

Note: See TracTickets for help on using tickets.