Fixing broken dependencies

Doug Barton dougb at FreeBSD.org
Sat Dec 30 14:23:19 PST 2006


Mark Ovens wrote:
> I used pkg_delete(1) to remove several unwanted ports but now
> portmanager reports them as missing because they are still listed as in
> the +CONTENTS of other packages

Interesting that portmanager does that check. Currently portmaster
does not, is it something that people would find useful? Perhaps as
part of -l, or -a? Personally, I sometimes do exactly what you're
talking about here myself with pkg_delete, and wouldn't want
portmaster to complain about something being "missing" that I'd
intentionally deleted. But that's just me. :)

That said, I already have an "expunge" command that deals with the
port, and all of its distfiles. I recently added functionality to
portmaster to NOT do the pkg_delete if the port has dependencies
listed in other port's contents files (since I think this is the best
anti-foot-shooting behavior for the general user). Would it be useful
to add an option for "extreme expunge" that first removes all
dependency entries, then pkg_delete's the port itself?

> What is the best way to fix this? If I run ``portmanager -u'' to upgrade
> all the ports I suspect that it will simply reinstall all the ports it
> considers are missing.
> 
> I'm sure I know how to do this, but I can't remember :(

I would do something like this. (Watch out for line wrap.)

for file in /var/db/pkg/*/+CONTENTS; do
	egrep -v "@pkgdep koffice|DEPORIGIN:editors/koffice-kde3" $file >
$file.grep && mv $file.grep $file
done


hth,

Doug

-- 

    This .signature sanitized for your protection


More information about the freebsd-ports mailing list