install-patch-install cycles & install without activate

Ryan Schmidt ryandesign at macports.org
Wed May 30 20:30:47 UTC 2018


On May 29, 2018, at 14:10, macports at parvis.nl wrote:

> On 2018-05-29, at 20:41, Ryan Schmidt wrote:
> 
>> On May 29, 2018, at 13:31, macports at parvis.nl wrote:
>> 
>>> I'm trying to work as much as possible with scripted procedures.
>>> 
>>> After an initial install of a new/modified port, I need to apply/change patches.
>>> 
>>> My workflow is:
>>> 
>>> port install munin
>>> 
>>> #- cycle start
>>> port clean --work munin
>>> create patches against the unmodified tarball
>>> port clean --work munin
>>> port install munin
>>> test
>>> #- cycle end
>>> 
>>> Problem here is that if Portfile  isn't changed, install will skip all phases, including checksum, extract, patch, configure, build, destroot, "install", activate.
>>> I can port clean --all munin but then I need to fetch again, and that is not needed.
>> 
>> Then don't use "sudo port clean --all". Just use "sudo port clean".
> 
> I do: port clean --work should be the same as port clean.

Ok.

>> Or, sometimes it's helpful to edit the state file. (The file named .macports.${subport}.state inside the directory identified by the command `port work`.) You can delete the lines for the phases that you want MacPorts to run again.
> 
> That is what I did originally, but then i thought that clean work/create/patches/clean work is a "cleaner" way.

You can use whichever method works best for you in a particular situation. I usually clean a port and start over when I've made a change during development, but sometimes, especially for ports that take a long time to build, I edit the statefile or find other ways to continue the build without cleaning. For example, if a port fails during the destroot phase, I might be able to fix it by just editing the destroot directives in the Portfile, deleting the destroot directory, and then retrying the installation and using the -o flag to prevent MacPorts from cleaning the work directory.

>>> Q1) What is the port command to execute all needed phases, starting with patch?
>>> 
>>> Somewhere it says something like install creates a tarball from destroot, activate unpackes that tarball.
>>> Above I wrote "install" because I'm looking for the port verb that does exactly this.
>>> I would like to be able to do the complete installation process without activate.
>>> 
>>> My experience is this:
>>> port install does
>>> - if activated: nothing
>>> - else: do all steps from $(port work munin)/.macportsmunin.state
>>> Is this correct? If this is true, port deactivate munin && port install munin would be enough.
> 
> Could you answer this one please?

Indeed, if a port is already installed with the same variants, port install doesn't do much. (If it's installed but with different variants, then it would be installed with the new variants.)

Not sure what you mean by "do all steps from $(port work munin)/.macportsmunin.state". The statefile records the steps that have already been completed. If you port install, MacPorts will resume from the next not-yet-completed step.


>>> Q2) What is the port command to execute all needed phases, except activate?
>> 
>> I don't think any such command exists. Why do you want this?
> 
> I don't really think I need it. It is -maybe- a solution to the problem stated above.

I guess I'm not entirely clear on what the problem is that you're trying to solve, so it's hard to suggest solutions.

> If I change the contents of a patch without changing the Portfile, port install does notihng.

That's correct.

> This *maybe* missing verb could *maybe* force a rebuild.
> Alternate suggestion above: use deactivate + install to force that rebuild.

The rebuild command is:

sudo port -ns upgrade --force





More information about the macports-dev mailing list