Check for all port dependencies

DutchDaemon

Administrator
Staff member
Administrator
Moderator
Developer

Reaction score: 2,829
Messages: 11,314

And if you mean "which port depends on which ports", either run [cmd=]pkg_info -rR <portglob>[/cmd] for an installed port, or run [cmd=]make build-depends-list && make run-depends-list[/cmd] in a port directory under /usr/ports.

Finally: if you wonder which dependencies you still need to install for a port, run [cmd=]make missing[/cmd] in a port directory under /usr/ports.
 

avilla@

Well-Known Member
Developer

Reaction score: 59
Messages: 258

DutchDaemon said:
And if you mean "which port depends on which ports", either run [cmd=]pkg_info -rR <portglob>[/cmd] for an installed port, or run [cmd=]make build-depends-list && make run-depends-list[/cmd] in a port directory under /usr/ports.
and $ make all-depends-list will list all the dependencies, including grandchildren and so on going down the tree
 
OP
OP
C

ccc

Aspiring Daemon

Reaction score: 12
Messages: 621

Thx, but howto check for all already installed, dependent packages from a port?
 

graudeejs

Son of Beastie

Reaction score: 694
Messages: 4,615

simple solution
Code:
$ portmaster --show-work x11-wm/fvwm2-devel
it will show all dependancies that are not installed and that will be installed, if you run portmaster without --show-work, it'll also show which dependencies will be updated ;)

Note, might not be the best solution, since it doesn't check if all packages have all files, maybe some files were deleted etc.....
 

billgates

New Member


Messages: 15

does FreeBSD have a archlinux equivalent of

PHP:
  #pacman -Ql package
- this will query the package database and List all files owned by a given package.

eg:
Code:
root@myhost ~#pacman -Ql mlocate
mlocate /etc/
mlocate /etc/cron.daily/
mlocate /etc/cron.daily/updatedb
mlocate /etc/updatedb.conf
mlocate /usr/
mlocate /usr/bin/
mlocate /usr/bin/locate
mlocate /usr/bin/slocate
mlocate /usr/bin/updatedb
mlocate /usr/share/
mlocate /usr/share/locale/
mlocate /usr/share/locale/ast/
.....
 

jb_fvwm2

Daemon

Reaction score: 181
Messages: 1,695

Also, the pkg-plist in the /port/ can be useful. One
can for example, grep it ...
Code:
grep bin /usr/ports/security/sudosh/pkg-plist
 
Last edited by a moderator:

manilaboy1vic

Member

Reaction score: 3
Messages: 61

Is there a way to see the reverse of make build-depends-list && make run-depends-list?

For example, I want to remove linux_base-f10-10_9. I want to know if any of the other ports depend on it.

For example, what will break once I delete linux_base-f10-10_9?
 

kpa

Beastie's Twin

Reaction score: 1,810
Messages: 6,318

Is there a way to see the reverse of make build-depends-list && make run-depends-list?

For example, I want to remove linux_base-f10-10_9. I want to know if any of the other ports depend on it.

For example, what will break once I delete linux_base-f10-10_9?
It's not easy to figure out which ports are going to depend on a particular port until the ports get built and installed. The cross-reference information that would be needed just isn't there in the ports tree in any kind of pre-computed way, it would have to be done by searching the whole ports tree for references to the particular port by running make all-depends-list or make run-depends-list on every port except the one that is being examined.

Edit: The dependency information is available in INDEX-* files so they can be used to speed up the process.
 

free-and-bsd

Aspiring Daemon

Reaction score: 74
Messages: 684

Is there a way to see the reverse of make build-depends-list && make run-depends-list?

For example, I want to remove linux_base-f10-10_9. I want to know if any of the other ports depend on it.

For example, what will break once I delete linux_base-f10-10_9?
I know it's been a while, but I've come across a similar question. Actually a simple script can help to deal with that:
Code:
#!/usr/local/bin/bash
pkg info -ao | awk '{ print $2 }' |
while read line
do
cd /usr/ports/$line
if [ -n "$(make run-depends-list | grep linux_base-f10)" ]; then
  echo "$line depends on linux_base-f10"
fi
done
Since all run dependencies, unlike build dependencies, are kept in place and are found among the installed packages, there must be no problem about it.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,905
Messages: 31,206

Since the script only checks installed ports you might as well use pkg info -r linux_base-f10

pkg-info(8):
Code:
     -r, --required-by
             Display the list of packages which require pkg-name.
 

free-and-bsd

Aspiring Daemon

Reaction score: 74
Messages: 684

Yea, so it says. But I was a bit mistrusting it after it failed to show me why certain packages were persistently rebuilt (by portmaster) after removal, while "no installed package needed them" according to the pkg -r ... output.
 

Zirias

Aspiring Daemon

Reaction score: 224
Messages: 609

Yea, so it says. But I was a bit mistrusting it after it failed to show me why certain packages were persistently rebuilt (by portmaster) after removal, while "no installed package needed them" according to the pkg -r ... output.
Probably because another rebuilt port needs them to build. pkg will only show runtime dependencies, which is enough for binary packages.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,905
Messages: 31,206

Yes, exactly. It shows runtime and library dependencies. Not the build dependencies (which aren't needed for a package).
 

free-and-bsd

Aspiring Daemon

Reaction score: 74
Messages: 684

So that is why my script above instead of just pkg -r ..., it originally contained all-depends-list instead of run-depends-list.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,905
Messages: 31,206

Your script only shows run dependencies (run-depends-list).
 

free-and-bsd

Aspiring Daemon

Reaction score: 74
Messages: 684

Sorry, it originally contained all-depends-list or build-depends-list ;) Forgot to mention.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,905
Messages: 31,206

In this case it probably won't matter, as far as I know emulators/linux_base-f10 is never a build or library dependency. It's only a run dependency. But I haven't checked all 25.000+ ports ;)
 
Top