]> Pileus Git - ~andy/sunrise/blobdiff - scripts/portdupe
sci-visualization/tulip: Fix qt deps
[~andy/sunrise] / scripts / portdupe
index 98f8051c6e42512fe1cbd1ce33906993d6e41a92..fd03f84383bf653fda2c48a608628c32fa12aebf 100755 (executable)
@@ -1,10 +1,9 @@
 #!/bin/bash
 #
-# Copyright 2006 David Shakaryan <d@ompty.org>
+# Copyright 2006 David Shakaryan <omp@gentoo.org>
 # Distributed under the terms of the GNU General Public License v2
 
-# Change portage tree directory if you have it elsewhere.
-PORTDIR="/usr/portage"
+PORTDIR="$(portageq envvar PORTDIR)"
 
 # If an argument is present, use it as the overlay directory.
 if [ $1 ]; then
@@ -13,7 +12,7 @@ fi
 
 # Checking, displaying, etc.
 for PACKAGE in */*; do
-       if [[ -d ${PORTDIR}/${PACKAGE} ]] && [[ $(basename ${PACKAGE}) != "CVS" ]] && echo ${PACKAGE} | grep -qv ${PORTDIR}/profiles/categories; then
+       if [[ -d ${PORTDIR}/${PACKAGE} ]] && [[ $(basename ${PACKAGE}) != "CVS" ]] && grep -q $(dirname ${PACKAGE}) ${PORTDIR}/profiles/categories; then
                # Reset versions from last package checked.
                PORTPACK_VERS=""
                OVERPACK_VERS=""