Skip to content

Commit

Permalink
bee-check: fix reading the CONTENT file and the filename handling
Browse files Browse the repository at this point in the history
there were problems if a filename contains spaces

replacing the for loop and always quoting the arguments fixes this issue
  • Loading branch information
Matthias Ruester committed Feb 24, 2013
1 parent 14c106f commit 2d2a0c3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/bee-check.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ do_check() {

echo "checking ${pkg} .."

for line in $(cat ${filesfile}) ; do
eval $(${BEESEP} ${line})
while read line ; do
eval $(${BEESEP} "${line}")

# save and strip possible symbolic link destination..
symlink=${file#*//}
Expand All @@ -246,7 +246,7 @@ do_check() {
if [ ! -h "${file}" ] ; then
echo " [changed] <was symlink to ${symlink}> ${file}"
else
sdest=$(readlink ${file})
sdest=$(readlink "${file}")
if [ "${sdest}" != "${symlink}" ] ; then
echo " [changed] <symlink destination '${symlink}' != '${sdest}'> ${file}"
fi
Expand All @@ -262,7 +262,7 @@ do_check() {
fi
else
# regular file - check md5sum..
md5now=$(md5sum ${file} | sed -e 's,^\([a-z0-9]*\).*$,\1,')
md5now=$(md5sum "${file}" | sed -e 's,^\([a-z0-9]*\).*$,\1,')

if [ "${md5}" != "${md5now}" ] ; then
echo " [changed] <md5 ${md5} != ${md5now}> ${file}"
Expand All @@ -271,7 +271,7 @@ do_check() {

# check mode, uid and gid of directory/file

stat=( $(stat ${file} --printf "%f %u %g %U %G") )
stat=( $(stat "${file}" --printf "%f %u %g %U %G") )

full=$(printf "0%o" 0x${stat[0]})

Expand All @@ -286,7 +286,7 @@ do_check() {
if [ "${gid}" != "${stat[2]}" ] ; then
echo " [changed] <gid ${gid} (${group}) != ${stat[2]} (${stat[4])})> ${file}"
fi
done
done < "${filesfile}"

}

Expand Down

0 comments on commit 2d2a0c3

Please sign in to comment.