Skip to content

Commit

Permalink
bee-check: 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 407f531 commit f926892
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions src/bee-check.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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}]"

Expand Down Expand Up @@ -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

Expand All @@ -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} .."

Expand All @@ -241,7 +252,7 @@ do_check() {
continue
fi

if [ "${md5}" = "link" ] ; then
if [ "${type}" = "symlink" ] ; then
if [ ! -h "${file}" ] ; then
echo " [changed] <was symlink to ${symlink}> ${file}"
else
Expand All @@ -254,7 +265,7 @@ do_check() {
continue
fi

if [ "${md5}" = "directory" ] ; then
if [ "${type}" = "directory" ] ; then
if [ ! -d "${file}" ] ; then
echo " [changed] <was directory> ${file}"
fi
Expand Down

0 comments on commit f926892

Please sign in to comment.