summaryrefslogtreecommitdiff
path: root/trunk/src/qpkg
diff options
context:
space:
mode:
authorlostlogic <lostlogic@gentoo.org>2003-06-08 20:24:23 +0000
committerlostlogic <lostlogic@gentoo.org>2003-06-08 20:24:23 +0000
commit7d609e7feb51e05fa4b941d3b693e10cbf90f742 (patch)
treed28d57ba909843c469a735b15867075b83c5d057 /trunk/src/qpkg
parent8fdc5a09d8fe0531f12249f9bf74638d4103d86d (diff)
downloadgentoolkit-7d609e7feb51e05fa4b941d3b693e10cbf90f742.tar.gz
Fixage from bug 15771
svn path=/; revision=27
Diffstat (limited to 'trunk/src/qpkg')
-rw-r--r--trunk/src/qpkg/qpkg23
1 files changed, 19 insertions, 4 deletions
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 <lostlogic@gentoo.org>
+# Additional code thanks to:
+# Josh Goebel <dreamer@firesedge.org>
#
# $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