# Upgrade just the dependencies of a port



## loop (Jun 16, 2010)

Is there a way to upgrade just the dependencies of a particular port using portmaster or system tools?

Let's use the example of gettext - I've upgraded gettext using a binary package:
`# pkg_add -r gettext`

How can I upgrade the dependencies, but not gettext itself?


----------



## graudeejs (Jun 16, 2010)

Uhhhh :< I couldn't reply to this post (something failed many times server side)

so here's my reply
http://pastebin.com/0QBBc58v


----------



## SirDice (Jun 16, 2010)

If you use portmaster something like this will do the trick:
`# portmaster -r gettext -x gettext`


----------



## loop (Jun 17, 2010)

SirDice said:
			
		

> If you use portmaster something like this will do the trick:
> `# portmaster -r gettext -x gettext`



This doesn't work as expected:

```
# portmaster -r gettext -x gettext

===>>> Currently installed version: gettext-0.18
===>>> Port directory: /usr/ports/devel/gettext

===>>> Gathering distinfo list for installed ports

===>>> Launching 'make checksum' for devel/gettext in background
===>>> Gathering dependency list for devel/gettext from ports
===>>> Starting recursive 'make config' check
===>>> Recursive 'make config' check complete for devel/gettext
===>>> Checking ports that depend on gettext-0.18

===>>> Launching child to update bash-4.1.5_2
        gettext-0.18 >> bash-4.1.5_2
```
<snip much output>

```
===>>> Done checking ports that depend on gettext-0.18


===>>> The following actions will be taken if you choose to proceed:
        Upgrade gettext-0.18 to gettext-0.18_1
        Re-install bash-4.1.5_2
<etc>
```

You can see that portmaster still wants to upgrade gettext.


----------



## jb_fvwm2 (Jun 17, 2010)

For a single port (bash?)

```
cp -iv /usr/local/lib/libintl.so.8 /usr/local/lib/compat
/bin/rm -v /usr/local/lib/libinitl.so.8
cd /usr/ports/shells/bash
/bin/rm -rf work
pkg_delete -f /var/db/pkg/bash-[number] && make install
```
More complex methods maybe hackable from the manpage of
portmaster.  This method I quoted would become
unworkable with too many .so. files to copy (IF that
was the principal thing installed by the port). And
one would have to remember to later remove the
libintl.so.8...
.......................
I can see using this method for slower-than-usual
upgrades of gettext, png, jpeg, curl... etc but
if you have a specific reason as to the first post
in this thread someone may have a better idea.


----------



## loop (Jun 17, 2010)

It's not one port - it's every port that depends on gettext.

libintl.so.8 doesn't exist.  If I symlink libintl.so.9 (which does exist) to libintl.so.8 I still get the same issue.


----------



## graudeejs (Jun 17, 2010)

does it also supports command completion?


----------



## jb_fvwm2 (Jun 17, 2010)

And the ultimate aim?
1... backup v8, install v9, upgrade dep, deinstall 9
.... restore v8
2... rename v8 to v9, upgrade, rename v9 to v8
3... ???
The issue seems to be the aim of upgrading dependencies
without the port itself.  I cannot think of a reason why
one would want to do so, however, there would be usually
multiple (not easy) ways.  Someone posting a more
informative answer may want much more information.


----------



## loop (Jun 17, 2010)

jb_fvwm2 said:
			
		

> And the ultimate aim?
> 1... backup v8, install v9, upgrade dep, deinstall 9
> .... restore v8
> 2... rename v8 to v9, upgrade, rename v9 to v8
> ...



This thread contains the reason for my question.


----------



## jb_fvwm2 (Jun 17, 2010)

Ah, php5, maybe see the long recent threads in
the freebsd-questions list.   Way more complex
than my answer.  And still no information about
which explicit ports you want to (upgrade) and
(ignore upgrade).  Also, see UPDATING re:
libtool
php


----------



## loop (Jun 17, 2010)

jb_fvwm2 said:
			
		

> Ah, php5, maybe see the long recent threads in
> the freebsd-questions list.   Way more complex
> than my answer.  And still no information about
> which explicit ports you want to (upgrade) and
> ...



The exact ports don't actually matter - what matters is the method to do so.  As the thread mentioned you'll see that it's the gettext upgrade that broke stuff - so installing gettext from packages and then building dependant ports without rebuilding gettext was a theory I had in getting rid of the error 
	
	



```
libtool: link: unknown library version type `freebsd-'
```


----------



## jb_fvwm2 (Jun 18, 2010)

Why from packages, why not from ports; and which
version was the package? You could use the
+REQUIRED_BY from /gettext-/ in /var/db/pkg, 
(after pkgdb -u ; pkgdb -F) *maybe* as fed to
portmaster (example at bottom of its man page). Though I say
maybe because no time to think here about
whether it would work without error or unwanted effect.


----------



## loop (Jun 18, 2010)

> You could use the
> +REQUIRED_BY from /gettext-/ in /var/db/pkg,
> (after pkgdb -u ; pkgdb -F) *maybe* as fed to
> portmaster (example at bottom of its man page). Though I say
> ...


That's interesting - may have to look into that.

I ended up fixing the root issue by moving /usr/bin/objformat out of the way - figured this out by over two days of searching and ended up finding this message

I thi^H^H know, since the system in question has never been reinstalled since FreeBSD4.4 (only upgraded) there is a lot of cruft floating around.  In 8.0, /usr/bin/objformat does not get installed.

I don't think I've ever done `make delete-old` from single-user mode either ....

Lesson learned there!


----------

