Opened 7 years ago

Last modified 7 years ago

#55637 new enhancement

allow port reactivation (WIP)

Reported by: RJVB (René Bertin) Owned by:
Priority: Normal Milestone:
Component: base Version:
Keywords: Cc:
Port:

Description

This is a little modification that allows doing something we've discussed this before, months ago: reactivating an already active port. The main intended application is to exclude almost the entire $prefix from (TimeMachine) incremental backup schemes except the crucial folders under var/macports (at least the port tree(s) and images and the registry). As an added bonus it make it trivial to repair or revert changes you made to an active port.

The change does not introduce a new verb but simply reuses the -f option so that port activate -f foo acts deactivates and then reactivates the currently active port. I think this is intuitive enough not to require the introduction of a new verb, and probably even a bit more appropriate if you restore ports from the registry into an otherwise empty prefix.

A priori a global restore should become possible with

> port activate -f active

Attachments (2)

patch-allow-reactivation.diff (2.3 KB) - added by RJVB (René Bertin) 7 years ago.
patch-allow-reactivation.2.diff (2.3 KB) - added by RJVB (René Bertin) 6 years ago.

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by RJVB (René Bertin)

comment:1 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Flags that go after port and before the action verb use a single dash and a single character, e.g. sudo port -n upgrade. Flags that go after the action verb use two dashes and multiple characters, e.g. sudo port upgrade --enforce-variants. So, if you are introducing a new flag to force activations, and it applies to only the activate verb, then it should be named --force, not -f.

comment:2 Changed 7 years ago by RJVB (René Bertin)

Sorry, my bad, this is actually equivalent to

> port -f activate foo

(whether that's intentional or not). So no new flags, just a stronger interpretation of the existing force flag.

I noticed after creating this ticket that an accompanying change is required to the port driver, so that action_activate always calls the patched composite and not the simple activation procedure. That too can be coupled to the global force option.

Changed 6 years ago by RJVB (René Bertin)

Note: See TracTickets for help on using tickets.