From: lostlogic Date: Sun, 8 Jun 2003 20:24:23 +0000 (-0000) Subject: Fixage from bug 15771 X-Git-Tag: gentoolkit-0.2.4.3~475 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7d609e7feb51e05fa4b941d3b693e10cbf90f742;p=gentoolkit.git Fixage from bug 15771 svn path=/; revision=27 --- diff --git a/trunk/src/qpkg/qpkg b/trunk/src/qpkg/qpkg index b409f09..1eac75e 100644 --- a/trunk/src/qpkg/qpkg +++ b/trunk/src/qpkg/qpkg @@ -6,6 +6,8 @@ # This program is distributed under the terms of GPL version 2. # # Maintainer: Brandon Low +# Additional code thanks to: +# Josh Goebel # # $Header$ ID='$Id$' @@ -16,6 +18,7 @@ PROG=`basename ${0}` # Parse args verb=0 group="*" +params=${#} while [ ${#} -gt 0 ] do a=${1} @@ -295,7 +298,9 @@ else ipak=`echo ${ipak}|sed -e "s: :\n:g"|grep ${group}` fi if [ ${arg} ]; then - ipak=`echo ${ipak}|sed -e "s: :\n:g"|grep ${arg}` + # avoid ${arg}="db" from pulling in every installed package + temp="/var/db/pkg/.*${arg}" + ipak=`echo ${ipak}|sed -e "s: :\n:g"|grep ${temp}` fi fi # not installed packages (yet:-) @@ -317,10 +322,20 @@ for p in ${ipak} ${upak} -;do # cut common prefix from ebuild name and mark installed/uninstalled packages # Note: iii/uuu will be replaced by the pipe at the end - n=`echo $p | sed -e "s:^/var/db/pkg/${X}/${X}/${X}.ebuild:iii \1/\3:" \ - -e "s:^/usr/portage/${X}/${X}/${X}\.ebuild:uuu \1/\3:"` - d=`dirname ${p}` + n=${p%.ebuild} + var_db_pkg="/var/db/pkg/" + n=${n/${var_db_pkg}/iii } + usr_portage="/usr/portage/" + n=${n/${usr_portage}/uuu } + n=${n/\/*\//\/} + + d=${p%\/*.ebuild} # faster d=`dirname ${p}` echo ${n} + + # if we have no passed parameters then + # we can skip the extra conditional checks + [[ ${params} == 0 ]] && continue; + if [ ${verb} -gt 1 ];then echo "vvv ${p}" fi