Ticket #18273 (closed defect: fixed)
post-activate code is not run if you call port activate
| Reported by: | ryandesign@… | Owned by: | macports-tickets@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | MacPorts 1.9.0 |
| Component: | base | Version: | 1.7.0 |
| Keywords: | registry2.0 | Cc: | devans@…, raimue@… |
| Port: |
Description
If you "port install" a port that has a post-activate block, it gets run. For example, wget's post-activate block tells you about a config file you can install (if you haven't already done so):
$ sudo port install wget ---> Fetching wget ---> Verifying checksum(s) for wget ---> Extracting wget ---> Applying patches to wget ---> Configuring wget ---> Building wget ---> Staging wget into destroot ---> Installing wget @1.11.4_1 ---> Activating wget @1.11.4_1 To customize wget, you can copy wgetrc.sample to wgetrc in /opt/local/etc and then make changes. ---> Cleaning wget $
However, if the port is deactivated, and you "port activate" it, the post-activate block does not run, which is unexpected:
$ sudo port deactivate wget @1.11.4_1 ---> Deactivating wget @1.11.4_1 $ sudo port activate wget @1.11.4_1 ---> Activating wget @1.11.4_1 $
Change History
comment:2 Changed 4 years ago by devans@…
- Cc devans@… added
Same problem observed with ffmpeg/ffmpeg-devel
comment:3 Changed 4 years ago by raimue@…
- Keywords registry2.0 added
- Cc raimue@… added
This is a registry problem as registry1.0 does not store any hooks in the receipt. We cannot assure that the Portfile will be still valid or even available at the time of running de-/activate.
I didn't check again, but registry2.0 contains stubs to store pre-/post-uninstall hooks, it should do the same for de-/activate.
The notes issue will be fixed by #421.
Note: See
TracTickets for help on using
tickets.


See also #11562, the request to remove the post-activate and post-install blocks and replace them with a "finalize" phase.