#!/bin/bash
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-src/portage/bin/find-packages,v 1.3 2003/02/22 16:59:08 carpaski Exp $

filelist=`sed "s/['\"]/\\\&/g"`

for f in $filelist ; do
	file=`grep -r "$f ->" /var/db/pkg/*/*/CONTENTS`
	file=${file#/*/*/*/*/}
	file=${file%*/CONTENTS:*}
	echo $file
done | sort -u
