Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Oct 2007 19:39:32 +0200
From:      Mel <fbsd.questions@rachie.is-a-geek.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: I performed an rm -r on /var/lib/pkg
Message-ID:  <200710121939.32491.fbsd.questions@rachie.is-a-geek.net>
In-Reply-To: <1192208279.33933.84.camel@secretariat.lanl.gov>
References:  <1192134379.33933.9.camel@secretariat.lanl.gov> <1192142367.33933.32.camel@secretariat.lanl.gov> <1192208279.33933.84.camel@secretariat.lanl.gov>

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

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.
-- 
Mel



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710121939.32491.fbsd.questions>