Skip to content

Commit

Permalink
bee-query: Add support for new CONTENT file
Browse files Browse the repository at this point in the history
  • Loading branch information
mariux committed May 21, 2012
1 parent f926892 commit 8a73300
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/bee-query.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,14 @@ query() {
get_files() {
pkg=${1}

if [ ! -e "${BEE_METADIR}/${pkg}/CONTENT" ] ; then
${BEE_LIBEXECDIR}/bee/compat-filesfile2contentfile \
${BEE_METADIR}/${pkg}/FILES \
>${BEE_METADIR}/${pkg}/CONTENT
fi

for s in "" "${BEE_METADIR}" ; do
ff="${s}/${pkg}/FILES"
ff="${s}/${pkg}/CONTENT"
if [ -e "${ff}" ] ; then
for line in $(cat ${ff}) ; do
eval $(${BEESEP} ${line})
Expand All @@ -79,10 +85,16 @@ get_files() {
get_pkgs() {
f=$1

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
for pkg in $(${BEE_LIBEXECDIR}/bee/bee.d/bee-list --installed) ; do
if [ ! -e "${BEE_METADIR}/${pkg}/CONTENT" ] ; then
${BEE_LIBEXECDIR}/bee/compat-filesfile2contentfile \
${BEE_METADIR}/${pkg}/FILES \
>${BEE_METADIR}/${pkg}/CONTENT
fi

if egrep -q "file=.*${f}" ${BEE_METADIR}/${pkg}/CONTENT ; then
echo ${pkg}
for line in $(egrep "file=.*${f}" ${BEE_METADIR}/${pkg}/CONTENT) ; do
eval $(${BEESEP} ${line})
echo " ${file}"
done
Expand Down

0 comments on commit 8a73300

Please sign in to comment.