Ticket #16234 (closed defect: fixed)
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
Change History
Changed 5 years ago by blb@…
- Attachment portindex.tcl.diff added
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.
Note: See
TracTickets for help on using
tickets.


diff to base/src/port/portindex.tcl