Commit 6bbe5369 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-sh-functions: add more diag info about tmp, drop rmdir for removed tmp files

parent ca9fd666
......@@ -771,6 +771,10 @@ assure_tmpdir()
warning "Your have no TMPDIR defined. Using $TMPDIR as fallback."
fi
if [ ! -d "$TMPDIR" ] ; then
fatal "TMPDIR $TMPDIR does not exist."
fi
if [ ! -w "$TMPDIR" ] ; then
fatal "TMPDIR $TMPDIR is not writable."
fi
......@@ -840,16 +844,17 @@ __epm_remove_tmp_files()
trap "-" EXIT
[ -n "$DEBUG" ] && return 0
[ -n "$verbose" ] && info "Removing tmp files on exit ..."
if [ -n "$to_clean_tmp_dirs" ] ; then
echo "$to_clean_tmp_dirs" | while read p ; do
rm -rf "$p" 2>/dev/null
rm $verbose -rf "$p" 2>/dev/null
done
fi
if [ -n "$to_clean_tmp_files" ] ; then
echo "$to_clean_tmp_files" | while read p ; do
rm -f "$p" 2>/dev/null
rmdir "$(dirname "$p")" 2>/dev/null
rm $verbose -f "$p" 2>/dev/null
done
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment