Commit cf12e226 authored by Vitaly Lipatov's avatar Vitaly Lipatov

move __epm_remove_tmp_files to epm-sh-functions

parent 3cc44a56
......@@ -23,21 +23,6 @@ load_helper epm-assure
[ -n "$EPM_PACK_SCRIPTS_DIR" ] || EPM_PACK_SCRIPTS_DIR="$CONFIGDIR/pack.d"
__epm_remove_tmp_files()
{
# TODO: move it to exit handler
if [ -z "$DEBUG" ] ; then
# TODO: reinvent
[ -n "$to_remove_pkg_files" ] && rm -f $to_remove_pkg_files
# hack??
[ -n "$to_remove_pkg_files" ] && rmdir $(dirname $to_remove_pkg_files | head -n1) 2>/dev/null
[ -n "$to_remove_pkg_dirs" ] && rmdir $to_remove_pkg_dirs 2>/dev/null
[ -n "$to_clean_tmp_dirs" ] && rm -rf $to_clean_tmp_dirs 2>/dev/null
fi
return 0
}
__epm_pack()
{
local packname="$1"
......
......@@ -399,20 +399,6 @@ __epm_repack_to_rpm()
}
__epm_remove_tmp_files()
{
# TODO: move it to exit handler
if [ -z "$DEBUG" ] ; then
# TODO: reinvent
[ -n "$to_remove_pkg_files" ] && rm -f $to_remove_pkg_files
# hack??
[ -n "$to_remove_pkg_files" ] && rmdir $(dirname $to_remove_pkg_files | head -n1) 2>/dev/null
[ -n "$to_remove_pkg_dirs" ] && rmdir $to_remove_pkg_dirs 2>/dev/null
[ -n "$to_clean_tmp_dirs" ] && rm -rf $to_clean_tmp_dirs 2>/dev/null
fi
return 0
}
# FIXME: Нужно как-то обеспечить непродолжение выполнения.
# used in epm install
# fill repacked_pkgs
......
......@@ -673,6 +673,22 @@ get_pkg_name_delimiter()
echo "-"
}
# usage: trap "__epm_remove_tmp_files" EXIT
__epm_remove_tmp_files()
{
# TODO: move it to exit handler
if [ -z "$DEBUG" ] ; then
# TODO: reinvent
[ -n "$to_remove_pkg_files" ] && rm -f $to_remove_pkg_files
# hack??
[ -n "$to_remove_pkg_files" ] && rmdir $(dirname $to_remove_pkg_files | head -n1) 2>/dev/null
[ -n "$to_remove_pkg_dirs" ] && rmdir $to_remove_pkg_dirs 2>/dev/null
[ -n "$to_clean_tmp_dirs" ] && rm -rf $to_clean_tmp_dirs 2>/dev/null
fi
return 0
}
has_space()
{
estrlist -- has_space "$@"
......
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