# portmaster: how to rebuild recursively dependencies of freshly upgraded port(s)?



## DeadLoco (Jan 4, 2011)

Does any canonical way exists to update ports AND rebuild everything that depends on them via "portmaster" like "portmanager -u" do?


----------



## DutchDaemon (Jan 4, 2011)

Should not be too hard to track that down in portmaster(8)?


----------



## wblock@ (Jan 4, 2011)

From portmaster(8):


> The focus of this tool is to keep the dependency tracking
> information for your ports up to date.  This allows you to safely update
> a specific port without having to update all of the ports "above" it.  In
> the rare case where you do need to recompile ports which depend on a port
> you are updating, the -r option exists to accomplish this.


----------



## wblock@ (Jan 4, 2011)

Simulpost!  (Also, there's "portupgrade -rf ...")


----------



## rbelk (Jan 4, 2011)

DeadLoco said:
			
		

> Does any canonical way exists to update ports AND rebuild everything that depends on them via "portmaster" like "portmanager -u" do?


 OMG, he said Canonical!


----------



## DeadLoco (Jan 4, 2011)

DutchDaemon said:
			
		

> Should not be too hard to track that down in portmaster(8)?


Sure not. All manuals have been read many times. But I'm still in troubles.

F.e. PHP been updated from 5.3.3 to 5.3.4 and portmaster perform it's updating as estimated.
But eAccelerator that dependent on PHP wasn't rebuilded. So every time apache started I've got

```
[eAccelerator] This build of "eAccelerator" was compiled for PHP version 5.3.3. Rebuild it for your PHP version (5.3.4) or download precompiled binaries.
```

Fine. Fortunately last build of eAccel still compliant with new .so but what happens later?

It's way easier for me to rebuild all +REQUIRED BYs on every single update, rather then wait for sudden port's inconsistencies and then hurrying in the far more wide cleanup.


----------



## DeadLoco (Jan 4, 2011)

wblock said:
			
		

> From portmaster(8):


Is it safe enough? 
Now I have alot of messages in logs that this and that port was built with old dependencies. That worrying me. Declarations that everything Ok don't chill me at all.

For a while I've used portmanager but now it fails on come critical ports (apache-itk-mpm) and I've look for other tool. The way portmaster work is a bit unusual for me.


----------



## DeadLoco (Jan 4, 2011)

rbelk said:
			
		

> OMG, he said Canonical!


Yep! Among colleagues we call proven solutions "canonical"


----------



## DutchDaemon (Jan 4, 2011)

/usr/ports/UPDATING is full of examples, and should be consulted on every upgrade/install anyway.


----------



## phoenix (Jan 4, 2011)

*-r* is specifically for this situation:  you update a port and need to recompile all the ports that use that port (like eAccelerator in your PHP setup). `# portmaster -r php`
That will update php, then recompile all the ports that depend on php.


----------



## troberts (Jan 5, 2011)

*Warning concerning the '-r' option in portmaster*

When JPEG was updated from JPEG-6.x to JPEG-7, I used the '-R -r' options immediately and when the update failed while compiling OpenOffice.org, I was not able to just fix the problem and start back up where it left off because there was no JPEG-6.x to update. I had to start everything over again and there were many ports that had to be rebuilt before OpenOffice.org even started its compile, then it spent hours just to get to where it had failed previously.

The things I learned from this is to rebuild the "base" port by itself so it can update all references to its updated version, then rebuild it using the '-R -r' options. Also, rebuild openoffice.org by itself overnight after deinstalling cppunit, which is the cause of openoffice.org failing its compile.

I was just looking at the man pages for portmaster and I could not find a switch that will rebuild all ports depending on a port without rebuilding said port.


----------



## DutchDaemon (Jan 5, 2011)

Have you tried *-x port* (port name in /var/db/pkg/) to exclude the port itself?

E.g.
[cmd=]portmaster -r jpeg- -x jpeg-8_3[/cmd]
(or the other way around -> both untested)


----------



## troberts (Jan 5, 2011)

DutchDaemon said:
			
		

> Have you tried *-x port* (port name in /var/db/pkg/) to exclude the port itself?
> 
> E.g.
> [cmd=]portmaster -r jpeg- -x jpeg-8_3[/cmd]
> (or the other way around -> both untested)


Yes, after a couple of times of not using the '-x' switch.


----------



## dougb@ (Jan 16, 2011)

troberts said:
			
		

> When JPEG was updated from JPEG-6.x to JPEG-7, I used the '-R -r' options immediately



That was mistake number one.   The first time through using -r or -f you do not use the -R option. Read the man page about what -R does if you're confused as to why.

Side note, most man pages are written to be scanned quickly and/or searched. The portmaster man page is designed to actually be *read*, especially the DESCRIPTION section. Not everything in there will make sense right away, but I suggest reading the man page all the way through, use the tool for a while, then go through and read the man page again. 



			
				troberts said:
			
		

> and when the update failed while compiling OpenOffice.org, I was not able to just fix the problem and start back up where it left off because there was no JPEG-6.x to update. I had to start everything over again and there were many ports that had to be rebuilt before OpenOffice.org even started its compile, then it spent hours just to get to where it had failed previously.



Mistake number 2.   Read the man page about the -r option, and what arguments it takes. There actually is a way to restart in this situation (although someone else already pointed out that trying to rebuild openoffice along with all your other ports is probably not a good idea). 



			
				troberts said:
			
		

> The things I learned from this is to rebuild the "base" port by itself so it can update all references to its updated version, then rebuild it using the '-R -r' options.



So once again, don't use -R the first time you use -r or -f. And while the method you describe here will work, it's going to end up duplicating some effort. 



			
				troberts said:
			
		

> I was just looking at the man pages for portmaster and I could not find a switch that will rebuild all ports depending on a port without rebuilding said port.



Try reading the -R bit again. 


hth,

Doug


----------



## DeadLoco (Jan 17, 2011)

> Try reading the -R bit again.


So is it safe enough to update some port and leave untouched ports that depends on it? How to determine that some dependency needs to be rebuilt? 

Sorry for nub's questions but I can't decide what to do - recursively and expensively rebuild whole branch on each node's update or wait until alarm messages overwhelms my logs.

Regards


----------

