Opened 16 years ago

Closed 16 years ago

#16234 closed defect (fixed)

portindex should be atomic

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: ryandesign (Ryan Carsten Schmidt)
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 (1)

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

Download all attachments as: .zip

Change History (7)

Changed 16 years ago by blb@…

Attachment: portindex.tcl.diff added

diff to base/src/port/portindex.tcl

comment:1 Changed 16 years ago by blb@…

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

comment:2 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Milestone: MacPorts base bugsMacPorts 1.7.0

comment:3 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

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

comment:4 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to ryandesign@…
Status: newassigned

comment:5 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Fixed in r41701.

comment:6 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

Updated ChangeLog in r41702.

Note: See TracTickets for help on using tickets.