Commit 5917d078 authored by Vitaly Lipatov's avatar Vitaly Lipatov

improve remove_on_exit()

parent d6352add
......@@ -410,8 +410,6 @@ epm_install_files()
if __epm_repack_if_needed $files ; then
[ -n "$repacked_pkgs" ] || fatal "Can't convert $files"
files="$repacked_pkgs"
# TODO
#__epm_remove_tmp_files
fi
if [ -n "$save_only" ] ; then
......@@ -465,8 +463,6 @@ epm_install_files()
if __epm_repack_if_needed $files ; then
[ -n "$repacked_pkgs" ] || fatal "Can't convert $files"
files="$repacked_pkgs"
# TODO
#__epm_remove_tmp_files
fi
if [ -n "$save_only" ] ; then
......@@ -667,9 +663,4 @@ epm_install()
fi
epm_install_files $files
local RETVAL=$?
__epm_remove_tmp_files
return $RETVAL
}
......@@ -247,5 +247,4 @@ epm_repack()
fi
fi
__epm_remove_tmp_files
}
......@@ -732,6 +732,7 @@ get_pkg_name_delimiter()
# used via remove_on_exit
__epm_remove_tmp_files()
{
trap "-" EXIT
[ -n "$DEBUG" ] && return 0
if [ -n "$to_clean_tmp_dirs" ] ; then
......@@ -753,7 +754,10 @@ __epm_remove_tmp_files()
remove_on_exit()
{
trap "__epm_remove_tmp_files" EXIT
if [ -z "$set_remove_on_exit" ] ; then
trap "__epm_remove_tmp_files" EXIT
set_remove_on_exit=1
fi
while [ -n "$1" ] ; do
if [ -d "$1" ] ; then
to_clean_tmp_dirs="$to_clean_tmp_dirs
......
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