Skip to content

Commit

Permalink
bee-query: refix - to get filename use 'beesep' instead of changing $IFS
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Dreyer authored and mariux committed Jul 14, 2011
1 parent e2ed2c2 commit 32e6836
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions src/bee-query.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ if [ -z ${BEE_VERSION} ] ; then
fi

VERSION=${BEE_VERSION}
BEESEP=@BINDIR@/beesep

##### usage ###################################################################
usage() {
Expand Down Expand Up @@ -61,7 +62,8 @@ get_files() {
ff="${s}/${pkg}/FILES"
if [ -e "${ff}" ] ; then
for line in $(cat ${ff}) ; do
beefind2filename $line
eval $(${BEESEP} ${line})
echo ${file}
done
fi
done
Expand All @@ -70,28 +72,17 @@ get_files() {
get_pkgs() {
f=$1

for i in ${BEE_METADIR}/* ; do
if egrep -q "file=.*${f}" ${i}/FILES ; then
echo ${i##*/}
for line in $(egrep "file=.*${f}" ${i}/FILES) ; do
echo " $(beefind2filename $line)"
for i in $(${BEE_LIBEXECDIR}/bee/bee.d/bee-list --installed) ; do
if egrep -q "file=.*${f}" ${BEE_METADIR}/${i}/FILES ; then
echo ${i}
for line in $(egrep "file=.*${f}" ${BEE_METADIR}/${i}/FILES) ; do
eval $(${BEESEP} ${line})
echo " ${file}"
done
fi
done
}

beefind2filename() {
line=$1

OLDIFS=${IFS}
IFS=":"
eval $line
echo $file
unset md5 mode nlink uid gid size mtime file
IFS=${OLDIFS}
}



###############################################################################
###############################################################################
Expand Down

0 comments on commit 32e6836

Please sign in to comment.