From 66e307e9aab43d52d2ff7d86f8bf0a83bec662f4 Mon Sep 17 00:00:00 2001 From: "mauro.giachero" Date: Fri, 28 Aug 2009 16:57:21 +0000 Subject: [PATCH] Fix the $SBOPKGTMP sanity check. 'find' prints the directory name as the first result, and if $SBOPKGTMP is not named after sbopkg it makes the sanity check fail. Fix this by making sure that 'find' doesn't ever return the directory name. Thanks to Ken Roberts for raising the issue. Signed-off-by: Mauro Giachero --- ChangeLog-current.txt | 2 ++ src/usr/sbin/sbopkg | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog-current.txt b/ChangeLog-current.txt index 98fd99d..5153b3e 100644 --- a/ChangeLog-current.txt +++ b/ChangeLog-current.txt @@ -3,5 +3,7 @@ Sbopkg 0.XX.X released. This version contains the following fixes and enhancements: * Fix the updates code for the 13.0 repo. + * Fix the $SBOPKGTMP sanity check. Thanks to Ken Roberts for raising the + issue. * Update the renames file. +--------------------------+ diff --git a/src/usr/sbin/sbopkg b/src/usr/sbin/sbopkg index 1e67ce7..658c5b7 100755 --- a/src/usr/sbin/sbopkg +++ b/src/usr/sbin/sbopkg @@ -143,8 +143,8 @@ EOF fi # Make sure there are no unexpected files in $SBOPKGTMP - if [[ -n $(find $SBOPKGTMP -maxdepth 1 -not -name sbopkg\* 2> \ - /dev/null) ]]; then + if [[ -n $(find $SBOPKGTMP -mindepth 1 -maxdepth 1 -not -name sbopkg\* \ + 2> /dev/null) ]]; then cat << EOF ERROR