From 5ae3aa7a021103702b2cf10d66c63b9eb4ef3226 Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Mon, 21 May 2012 14:56:05 +0200 Subject: [PATCH 1/5] compatibility: New FILES -> CONTENT converter add a script to convert the old FILES-file to the new CONTENT-file the script will be installed in LIBEXECDIR/bee/ --- Makefile | 16 ++++- src/compat-filesfile2contentfile.sh.in | 85 ++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 3 deletions(-) create mode 100755 src/compat-filesfile2contentfile.sh.in diff --git a/Makefile b/Makefile index 6f34565..dd26fa0 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,8 @@ PROGRAMS_PERL=beefind.pl HELPER_BEE_SHELL=bee-init bee-check bee-remove bee-install bee-list bee-query bee-download bee-update HELPER_BEE_C=bee-dep +HELPER_SHELL=compat-filesfile2contentfile + LIBRARY_SHELL=beelib.config.sh BUILDTYPES=configure cmake autogen perl-module perl-module-makemaker make python-module @@ -88,7 +90,7 @@ compat: compat-bashlt4 compat-bashlt4: ${COMPAT_BASHLT4} $(call quiet-command, sed ${sed-compat-bashlt4} -i ${COMPAT_BASHLT4}, "COMPAT $^" ) -SHELLSCRIPTS=$(PROGRAMS_SHELL) $(HELPER_BEE_SHELL) +SHELLSCRIPTS=$(PROGRAMS_SHELL) $(HELPER_BEE_SHELL) $(HELPER_SHELL) BEEVERSION_OBJECTS=beeversion.o bee_version_parse.o bee_version_compare.o bee_version_output.o BEESEP_OBJECTS=beesep.o @@ -144,7 +146,7 @@ beegetopt: $(addprefix src/, ${BEEGETOPT_OBJECTS}) $(call quiet-command,sed ${sed-rules} $< >$@,"SED $@") clean: - $(call quiet-command,rm -f $(addsuffix .sh,${SHELLSCRIPTS}) $(LIBRARY_SHELL),"CLEAN .sh") + $(call quiet-command,rm -f $(addsuffix .sh,${SHELLSCRIPTS}) $(LIBRARY_SHELL) $(HELPER_SHELL),"CLEAN .sh") $(call quiet-command,rm -f ${PROGRAMS_PERL},"CLEAN ${PROGRAMS_PERL}") $(call quiet-command,rm -f ${PROGRAMS_C},"CLEAN ${PROGRAMS_C}") $(call quiet-command,rm -f ${HELPER_BEE_C},"CLEAN ${HELPER_BEE_C}") @@ -154,7 +156,7 @@ clean: install: install-core install-config -install-core: build install-man install-hooks install-buildtypes install-beeshlib install-tools install-bin +install-core: build install-man install-hooks install-buildtypes install-beeshlib install-tools install-helper install-bin install-bin: $(addprefix ${DESTDIR}${BINDIR}/,${PROGRAMS_PERL} ${PROGRAMS_C} ${PROGRAMS_SHELL}) @@ -178,6 +180,14 @@ ${DESTDIR}${LIBEXECDIR}/bee/bee.d/%: %.sh install-dir-tools ${DESTDIR}${LIBEXECDIR}/bee/bee.d/%: % install-dir-tools $(call quiet-install,0755,$<,$@) +install-helper: $(addprefix ${DESTDIR}${LIBEXECDIR}/bee/,${HELPER_SHELL}) + +install-dir-helper: + $(call quiet-installdir,0755,${DESTDIR}${LIBEXECDIR}/bee) + +${DESTDIR}${LIBEXECDIR}/bee/%: %.sh install-dir-helper + $(call quiet-install,0755,$<,$@) + install-beeshlib: $(addprefix ${DESTDIR}${LIBEXECDIR}/bee/,${LIBRARY_SHELL}) install-dir-beeshlib: diff --git a/src/compat-filesfile2contentfile.sh.in b/src/compat-filesfile2contentfile.sh.in new file mode 100755 index 0000000..a8b6e85 --- /dev/null +++ b/src/compat-filesfile2contentfile.sh.in @@ -0,0 +1,85 @@ +#!/bin/bash +# +# bee-check - check consistency of installed bee-pkgs +# +# Copyright (C) 2009-2011 +# Marius Tolzmann +# Tobias Dreyer +# and other bee developers +# +# This file is part of bee. +# +# bee is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +: ${BEESEP=@BINDIR@/beesep} + +declare -A hardlink + +while read line ; do + md5="" + data=$(${BEESEP} ${line} 2>/dev/null) + + if [ $? -ne '0' ] ; then + echo >&2 "**ERROR** INVALID CONTENT: ${line}" + exit 1 + fi + + eval ${data} + + if [ $? -ne '0' -o -z "${md5}" ] ; then + echo >&2 "**ERROR** UNPARSABLE CONTENT: ${line}" + exit 1 + fi + + if [ "${md5}" = "directory" ] ; then + type='directory' + unset md5 + elif [ "${md5}" = "link" ] ; then + type='symlink' + unset md5 + elif [ "${md5}" = "block" ] ; then + type='block' + unset md5 + elif [ "${md5}" = "char" ] ; then + type='char' + unset md5 + else + type='regular' + fi + + if [ -z "${nlink}" ] ; then + nlink=1 + fi + + if [ "${type}" = "regular" -a ${nlink} -gt 1 ] ; then + key=$md5-$size-$nlink + if [ -n "${hardlink[$key]}" ] ; then + type=hardlink + file=${file}//${hardlink[$key]} + else + hardlink[$key]=$file + fi + fi + + echo -n "type=${type}" + printf ":mode=0%o" ${mode} + printf ":access=0%o" $(( ${mode} & 07777 )) + echo -n ":nlink=${nlink}:uid=${uid}:gid=${gid}:size=${size}:mtime=${mtime}" + if [ -n "${md5}" ] ; then + echo -n ":md5=${md5}" + fi + echo ":file=${file}" + +done < <(cat $@) From 73d7b233bf0815194498fcdcbb9112e2f9e79bb6 Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Mon, 21 May 2012 15:04:44 +0200 Subject: [PATCH 2/5] bee-install: Add support for new CONTENT file --- src/bee-install.sh.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/bee-install.sh.in b/src/bee-install.sh.in index 47e5ffd..f0977e1 100644 --- a/src/bee-install.sh.in +++ b/src/bee-install.sh.in @@ -360,12 +360,19 @@ function do_install_file() { start_cmd tar -x --dereference -${vv}Pf ${file} \ ${changedir} \ --transform="s,^FILES$,${BEE_METADIR}/${pkg}/FILES," \ + --transform="s,^CONTENT$,${BEE_METADIR}/${pkg}/CONTENT," \ --transform="s,^BUILD$,${BEE_METADIR}/${pkg}/${beefile}," \ --transform="s,^META$,${BEE_METADIR}/${pkg}/META," \ --transform="s,^PATCHES,${BEE_METADIR}/${pkg}/PATCHES," \ --transform="s,^DEPENDENCIES$,${BEE_METADIR}/${pkg}/DEPENDENCIES," \ --show-transformed-names + if [ ! -e "${BEE_METADIR}/${pkg}/CONTENT" ] ; then + ${BEE_LIBEXECDIR}/bee/compat-filesfile2contentfile \ + ${BEE_METADIR}/${pkg}/FILES \ + >${BEE_METADIR}/${pkg}/CONTENT + fi + run_hooks post-install ${pkg} ${BEE_LIBEXECDIR}/bee/bee.d/bee-check -d ${pkg} > ${BEE_METADIR}/${pkg}/DEPENDENCIES ${BEE_LIBEXECDIR}/bee/bee.d/bee-dep update ${pkg} From 407f531c65b491d2a4a95abdd031073b884a5a50 Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Mon, 21 May 2012 15:30:39 +0200 Subject: [PATCH 3/5] hooks: Add support for new CONTENT file additional minor cleanup in bee-remove to easier support new CONTENT file --- hooks/gconf-install-schemas.sh | 2 +- hooks/gdk-pixbuf-query-loaders.sh | 2 +- hooks/glib-compile-schemas.sh | 2 +- hooks/gtk-update-icon-cache.sh | 2 +- hooks/info-dir.sh | 4 ++-- hooks/ldconfig.sh | 2 +- hooks/mandb.sh | 4 ++-- hooks/mkfontdir-mkfontscale.sh | 2 +- hooks/systemd-tmpfiles.sh | 2 +- hooks/update-desktop-database.sh | 2 +- hooks/update-mime-database.sh | 2 +- src/bee-remove.sh.in | 33 +++++++++++++++---------------- 12 files changed, 29 insertions(+), 30 deletions(-) diff --git a/hooks/gconf-install-schemas.sh b/hooks/gconf-install-schemas.sh index ca4ad6f..b542b9d 100644 --- a/hooks/gconf-install-schemas.sh +++ b/hooks/gconf-install-schemas.sh @@ -38,7 +38,7 @@ fi case "${action}" in "post-install") - for s in $(grep -o "/.*gconf.*\.schemas" ${BEE_METADIR}/${pkg}/FILES 2>/dev/null) ; do + for s in $(grep -o "/.*gconf.*\.schemas" ${BEE_METADIR}/${pkg}/CONTENT 2>/dev/null) ; do echo "installing schema '${s##*/}'" ${GCONFTOOL} --install-schema-file ${s} >/dev/null done diff --git a/hooks/gdk-pixbuf-query-loaders.sh b/hooks/gdk-pixbuf-query-loaders.sh index 3ab84c7..3a658cc 100644 --- a/hooks/gdk-pixbuf-query-loaders.sh +++ b/hooks/gdk-pixbuf-query-loaders.sh @@ -41,7 +41,7 @@ if [ -z "${gdk_pixbuf_moduledir}" -o -z "${gdk_pixbuf_cache_file}" ]; then exit 0 fi -if grep -q "file=${gdk_pixbuf_moduledir}" ${BEE_METADIR}/${pkg}/FILES ; then +if grep -q "file=${gdk_pixbuf_moduledir}" ${BEE_METADIR}/${pkg}/CONTENT ; then case "${action}" in "post-install") rm -f ${gdk_pixbuf_cache_file} diff --git a/hooks/glib-compile-schemas.sh b/hooks/glib-compile-schemas.sh index 61bfb3d..45371fc 100644 --- a/hooks/glib-compile-schemas.sh +++ b/hooks/glib-compile-schemas.sh @@ -36,7 +36,7 @@ fi for dir in ${XDG_DATA_DIRS//:/ } ; do schema_dir=${dir}/glib-2.0/schemas - if grep -q "file=${schema_dir}" ${BEE_METADIR}/${pkg}/FILES ; then + if grep -q "file=${schema_dir}" ${BEE_METADIR}/${pkg}/CONTENT ; then case "${action}" in "post-install") rm -f ${schema_dir}/gschemas.compiled diff --git a/hooks/gtk-update-icon-cache.sh b/hooks/gtk-update-icon-cache.sh index 90df83a..d67b358 100644 --- a/hooks/gtk-update-icon-cache.sh +++ b/hooks/gtk-update-icon-cache.sh @@ -36,7 +36,7 @@ fi for dir in ${XDG_DATA_DIRS//:/ } ; do icon_base_dir=${dir}/icons - for line in $(grep -h "file=${icon_base_dir}/.*/index.theme" ${BEE_METADIR}/${pkg}/FILES) ; do + for line in $(grep -h "file=${icon_base_dir}/.*/index.theme" ${BEE_METADIR}/${pkg}/CONTENT) ; do eval $(beesep ${line}) icon_dir=${file%%/index.theme} case "${action}" in diff --git a/hooks/info-dir.sh b/hooks/info-dir.sh index 2475b32..170d797 100644 --- a/hooks/info-dir.sh +++ b/hooks/info-dir.sh @@ -50,13 +50,13 @@ fi case "${action}" in "post-install") - for i in $(grep -o "${PKG_INFODIR}.*\.info.*" ${BEE_METADIR}/${pkg}/FILES 2>/dev/null) ; do + for i in $(grep -o "${PKG_INFODIR}.*\.info.*" ${BEE_METADIR}/${pkg}/CONTENT 2>/dev/null) ; do echo "adding ${i##*/} to ${DIRFILE}" ${INSTALLINFO} ${i} ${DIRFILE} >/dev/null done ;; "pre-remove") - for i in $(grep -o "${PKG_INFODIR}.*\.info.*" ${BEE_METADIR}/${pkg}/FILES 2>/dev/null) ; do + for i in $(grep -o "${PKG_INFODIR}.*\.info.*" ${BEE_METADIR}/${pkg}/CONTENT 2>/dev/null) ; do echo "removing ${i##*/} from ${DIRFILE}" ${INSTALLINFO} --delete ${i} ${DIRFILE} >/dev/null done diff --git a/hooks/ldconfig.sh b/hooks/ldconfig.sh index 0233e8a..5f94bc7 100644 --- a/hooks/ldconfig.sh +++ b/hooks/ldconfig.sh @@ -38,7 +38,7 @@ if ! which ldconfig >/dev/null 2>&1 ; then exit 0 fi -if grep -q "/lib/" ${BEE_METADIR}/${pkg}/FILES ; then +if grep -q "/lib/" ${BEE_METADIR}/${pkg}/CONTENT ; then case "${action}" in "post-install") ldconfig diff --git a/hooks/mandb.sh b/hooks/mandb.sh index 6cfe35a..62ef6dc 100644 --- a/hooks/mandb.sh +++ b/hooks/mandb.sh @@ -44,7 +44,7 @@ fi for man_dir in $(beeuniq ${man_dirs//:/ }) ; do case "${action}" in "post-install") - for line in $(grep "file=${man_dir}" ${BEE_METADIR}/${pkg}/FILES) ; do + for line in $(grep "file=${man_dir}" ${BEE_METADIR}/${pkg}/CONTENT) ; do eval $(beesep ${line}) if [ -f "${file}" -o -L "${file}" ] ; then if [ -f "/var/cache/man/index.db" ] ; then @@ -58,7 +58,7 @@ for man_dir in $(beeuniq ${man_dirs//:/ }) ; do done ;; "post-remove") - if grep -q "file=${man_dir}" ${BEE_METADIR}/${pkg}/FILES ; then + if grep -q "file=${man_dir}" ${BEE_METADIR}/${pkg}/CONTENT ; then echo "updating manual index cache for ${man_dir} .." mandb -q ${man_dir} fi diff --git a/hooks/mkfontdir-mkfontscale.sh b/hooks/mkfontdir-mkfontscale.sh index 35f47c6..c499abe 100644 --- a/hooks/mkfontdir-mkfontscale.sh +++ b/hooks/mkfontdir-mkfontscale.sh @@ -55,7 +55,7 @@ function update_fonts() { for dir in ${XDG_DATA_DIRS//:/ } ; do font_base_dir=${dir}/fonts - if grep -q "file=${font_base_dir}" ${BEE_METADIR}/${pkg}/FILES ; then + if grep -q "file=${font_base_dir}" ${BEE_METADIR}/${pkg}/CONTENT ; then case "${action}" in "post-install") clean_font_dirs ${font_base_dir} diff --git a/hooks/systemd-tmpfiles.sh b/hooks/systemd-tmpfiles.sh index 6e90a12..173b27f 100644 --- a/hooks/systemd-tmpfiles.sh +++ b/hooks/systemd-tmpfiles.sh @@ -40,7 +40,7 @@ fi case "${action}" in "post-install") - if egrep --max-count=1 "file=(/etc|/lib|/usr/lib)/tmpfiles.d" ${BEE_METADIR}/${pkg}/FILES >/dev/null 2>&1 ; then + if egrep --max-count=1 "file=(/etc|/lib|/usr/lib)/tmpfiles.d" ${BEE_METADIR}/${pkg}/CONTENT >/dev/null 2>&1 ; then systemd-tmpfiles --create fi ;; diff --git a/hooks/update-desktop-database.sh b/hooks/update-desktop-database.sh index b9cb433..48d8f48 100644 --- a/hooks/update-desktop-database.sh +++ b/hooks/update-desktop-database.sh @@ -36,7 +36,7 @@ fi for dir in ${XDG_DATA_DIRS//:/ } ; do desktop_dir=${dir}/applications - if grep -q "file=${desktop_dir}/.*\.desktop" ${BEE_METADIR}/${pkg}/FILES ; then + if grep -q "file=${desktop_dir}/.*\.desktop" ${BEE_METADIR}/${pkg}/CONTENT ; then case "${action}" in "post-install") rm -f ${desktop_dir}/mimeinfo.cache diff --git a/hooks/update-mime-database.sh b/hooks/update-mime-database.sh index 77fc472..451aa70 100644 --- a/hooks/update-mime-database.sh +++ b/hooks/update-mime-database.sh @@ -36,7 +36,7 @@ fi for dir in ${XDG_DATA_DIRS//:/ } ; do mime_dir=${dir}/mime - if grep -q "file=${mime_dir}/packages" ${BEE_METADIR}/${pkg}/FILES ; then + if grep -q "file=${mime_dir}/packages" ${BEE_METADIR}/${pkg}/CONTENT ; then case "${action}" in "post-install") update-mime-database ${mime_dir} diff --git a/src/bee-remove.sh.in b/src/bee-remove.sh.in index 6d57239..a32a888 100644 --- a/src/bee-remove.sh.in +++ b/src/bee-remove.sh.in @@ -41,15 +41,9 @@ pkg_remove_all() { pkg_remove() { search=$1 - # pattern is absolute path to pkg - if [ -d "${search}" ] ; then - do_remove "${search}" - return - fi - # pattern is a pkg in BEE_METADIR if [ -d "${BEE_METADIR}/${search}" ] ; then - do_remove ${BEE_METADIR}/${search} + do_remove ${search} return fi @@ -62,15 +56,21 @@ pkg_remove() { do_remove() { pkg=${1} - FILES=$(${BEE_LIBEXECDIR}/bee/bee.d/bee-dep remove --print ${pkg##*/}) + if [ ! -e "${BEE_METADIR}/${pkg}/CONTENT" ] ; then + ${BEE_LIBEXECDIR}/bee/compat-filesfile2contentfile \ + ${BEE_METADIR}/${pkg}/FILES \ + >${BEE_METADIR}/${pkg}/CONTENT + fi + + FILES=$(${BEE_LIBEXECDIR}/bee/bee.d/bee-dep remove --print ${pkg}) if [ $? -ne 0 ] ; then - echo "removal of ${pkg##*/} failed" + echo "removal of ${pkg} failed" exit 1 fi [ "${NOOP}" != "yes" ] && run_hooks pre-remove ${pkg} - echo "removing package '${pkg##*/}'" + echo "removing package '${pkg}'" # removing files for f in $FILES ; do @@ -83,8 +83,8 @@ do_remove() { [ "${NOOP}" != "yes" ] && run_hooks post-remove ${pkg} - if [ -r "${pkg}/META" ] ; then - . ${pkg}/META + if [ -r "${BEE_METADIR}/${pkg}/META" ] ; then + . "${BEE_METADIR}/${pkg}/META" fi # removing empty basedirs @@ -97,15 +97,13 @@ do_remove() { done fi - #cleaning up meta directory - if [ -d "${pkg}" ] ; then - ${NOOP:+echo} rm -fr ${OPT_VERBOSE:+-v} ${pkg} - fi + #cleanup meta directory + ${NOOP:+echo} rm -fr ${OPT_VERBOSE:+-v} ${BEE_METADIR}/${pkg} } function run_hooks() { local action=${1} - local pkg=${2##*/} + local pkg=${2} for t in ${BEE_LIBEXECDIR}/bee/hooks.d/* ; do ${t} ${action} ${pkg} @@ -133,6 +131,7 @@ options=$(${BEE_BINDIR}/beegetopt --name bee-remove \ --option verbose/v \ --option help/h \ -- "$@") + if [ $? != 0 ] ; then usage exit 1 From f926892a962b5d93284fd49cd4c60e40e6de38f8 Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Mon, 21 May 2012 15:51:07 +0200 Subject: [PATCH 4/5] bee-check: Add support for new CONTENT file --- src/bee-check.sh.in | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/bee-check.sh.in b/src/bee-check.sh.in index 1f772ca..541492e 100644 --- a/src/bee-check.sh.in +++ b/src/bee-check.sh.in @@ -65,8 +65,14 @@ pkg_check_deps() { fi if [ "${installed}" ] ; then - for i in ${installed} ; do - do_check_deps "${i}" + for pkg in ${installed} ; do + if [ ! -e "${BEE_METADIR}/${pkg}/CONTENT" ] ; then + ${BEE_LIBEXECDIR}/bee/compat-filesfile2contentfile \ + ${BEE_METADIR}/${pkg}/FILES \ + >${BEE_METADIR}/${pkg}/CONTENT + fi + + do_check_deps "${pkg}" done fi exit 0 @@ -83,8 +89,13 @@ pkg_check() { fi if [ "${installed}" ] ; then - for i in ${installed} ; do - do_check "${i}" + for pkg in ${installed} ; do + if [ ! -e "${BEE_METADIR}/${pkg}/CONTENT" ] ; then + ${BEE_LIBEXECDIR}/bee/compat-filesfile2contentfile \ + ${BEE_METADIR}/${pkg}/FILES \ + >${BEE_METADIR}/${pkg}/CONTENT + fi + do_check "${pkg}" done return 0 fi @@ -177,7 +188,7 @@ do_check_deps_of_file() { ## do_check_deps() { local pkg=${1} - local filesfile=${BEE_METADIR}/${pkg}/FILES + local filesfile=${BEE_METADIR}/${pkg}/CONTENT echo -e "[${pkg}]" @@ -208,9 +219,9 @@ do_check_deps() { echo " size = ${size}" echo " mtime = ${mtime}" - if [ "${md5}" = "link" ] ; then + if [ "${type}" = "symlink" ] ; then echo " symlink = ${symlink}" - elif [ "${md5}" != "directory" ] ; then + elif [ "${type}" = "regular" -o "${type}" = "hardlink" ] ; then echo " md5 = ${md5}" fi @@ -225,7 +236,7 @@ do_check_deps() { do_check() { local pkg=${1} - local filesfile=${BEE_METADIR}/${pkg}/FILES + local filesfile=${BEE_METADIR}/${pkg}/CONTENT echo "checking ${pkg} .." @@ -241,7 +252,7 @@ do_check() { continue fi - if [ "${md5}" = "link" ] ; then + if [ "${type}" = "symlink" ] ; then if [ ! -h "${file}" ] ; then echo " [changed] ${file}" else @@ -254,7 +265,7 @@ do_check() { continue fi - if [ "${md5}" = "directory" ] ; then + if [ "${type}" = "directory" ] ; then if [ ! -d "${file}" ] ; then echo " [changed] ${file}" fi From 8a7330031e709390975f408e3b49f97ca92b7eed Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Mon, 21 May 2012 15:53:54 +0200 Subject: [PATCH 5/5] bee-query: Add support for new CONTENT file --- src/bee-query.sh.in | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/bee-query.sh.in b/src/bee-query.sh.in index 4acc3bf..92fc32e 100644 --- a/src/bee-query.sh.in +++ b/src/bee-query.sh.in @@ -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}) @@ -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