Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Dec 2006 14:23:16 -0800
From:      Doug Barton <dougb@FreeBSD.org>
To:        Mark Ovens <marko@freebsd.org>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: Fixing broken dependencies
Message-ID:  <4596E6D4.1070500@FreeBSD.org>
In-Reply-To: <45966C26.8080602@freebsd.org>
References:  <45966C26.8080602@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4596E6D4.1070500>