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

improve remove_on_exit()

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