I performed an rm -r on /var/lib/pkg

Mel fbsd.questions at rachie.is-a-geek.net
Fri Oct 12 10:39:35 PDT 2007

On Friday 12 October 2007 18:57:59 James wrote:
> This isn't quite as simple as I'd hoped it'd be to fix. Here's my
> findings thus far (I haven't started writing my script yet, but I will
> later today):
> 1. /usr/ports/distfiles contains everything I need
> 2. distfiles contains several versions of some packages, but that's
> pretty trivial to resolve.
> 3. distfiles contains some packages whose source tarballs are named
> *differently* to the packages themselves, such as unrar.
> It's number 3 that's getting me.  It looks like the simplest thing might
> be an if statement:
> if (make search name=$PACKAGE)
>     score!
> else
>     grep -r $PACKAGE /usr/ports
> But before I go that far, I wanted to see if anyone had an alternate
> idea for what might work.

Depends on your time and harddisk speed I suppose. You could:

for CAT in *; do
	if test -d ${CAT}; then
		cd ${PORTSDIR:="/usr/ports"}/${CAT}
		for PORT in *; do
			if test -d ${PORT}; then
				cd ${PORT}
				make -V DISTNAME >>/usr/ports/distname.idx
				cd ..

This would give you a distname index to work with. I checked INDEX-6 but don't 
see a DISTNAME listed in there. I suppose I'd make the decision myself based 
on how many I can't locate. Doing this for 10 ports I can easily guess myself 
is nice for academics, but not when you're on the clock.

More information about the freebsd-questions mailing list