Commit c05cacee authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm repack: fix error code

parent 8bf0f2d4
...@@ -309,11 +309,11 @@ epm_install_files() ...@@ -309,11 +309,11 @@ epm_install_files()
ALTLinux|ALTServer) ALTLinux|ALTServer)
# TODO: replace with name changed function # TODO: replace with name changed function
__epm_check_if_try_install_pkgtype deb $@ && return __epm_check_if_try_install_pkgtype deb $@ && return $RES
__epm_check_if_try_install_pkgtype AppImage $@ && return __epm_check_if_try_install_pkgtype AppImage $@ && return $RES
__epm_check_if_src_rpm $@ __epm_check_if_src_rpm $@
# do not using low-level for install by file path (FIXME: reasons?) # do not use low-level for install by file path (FIXME: reasons?)
if ! is_dirpath "$@" || [ "$(get_package_type "$@")" = "rpm" ] ; then if ! is_dirpath "$@" || [ "$(get_package_type "$@")" = "rpm" ] ; then
__epm_check_vendor $@ __epm_check_vendor $@
__epm_check_if_needed_repack $@ __epm_check_if_needed_repack $@
...@@ -356,8 +356,8 @@ epm_install_files() ...@@ -356,8 +356,8 @@ epm_install_files()
;; ;;
*-rpm) *-rpm)
__epm_check_if_try_install_pkgtype deb $@ && return __epm_check_if_try_install_pkgtype deb $@ && return $RES
__epm_check_if_try_install_pkgtype AppImage $@ && return __epm_check_if_try_install_pkgtype AppImage $@ && return $RES
__epm_check_if_src_rpm $@ __epm_check_if_src_rpm $@
sudocmd rpm -Uvh $force $noscripts $nodeps $@ && return sudocmd rpm -Uvh $force $noscripts $nodeps $@ && return
local RES=$? local RES=$?
......
...@@ -247,8 +247,7 @@ __epm_repack_to_rpm() ...@@ -247,8 +247,7 @@ __epm_repack_to_rpm()
./$alpkg --appimage-extract || fatal ./$alpkg --appimage-extract || fatal
alpkg=$PKGNAME-$VERSION.tar alpkg=$PKGNAME-$VERSION.tar
erc a $alpkg squashfs-root erc a $alpkg squashfs-root
fi else
VERSION="$(echo "$alpkg" | grep -o -P "[-_.]([0-9])([0-9])*(\.[0-9])*" | head -n1 | sed -e 's|^[-_.]||')" #" VERSION="$(echo "$alpkg" | grep -o -P "[-_.]([0-9])([0-9])*(\.[0-9])*" | head -n1 | sed -e 's|^[-_.]||')" #"
if [ -n "$VERSION" ] ; then if [ -n "$VERSION" ] ; then
PKGNAME="$(echo "$alpkg" | sed -e "s|[-_.]$VERSION.*||")" PKGNAME="$(echo "$alpkg" | sed -e "s|[-_.]$VERSION.*||")"
...@@ -264,6 +263,7 @@ __epm_repack_to_rpm() ...@@ -264,6 +263,7 @@ __epm_repack_to_rpm()
alpkg=$newalpkg alpkg=$newalpkg
fi fi
fi fi
fi
cd $tmpbuilddir/ || fatal cd $tmpbuilddir/ || fatal
...@@ -320,16 +320,17 @@ __epm_repack_to_rpm() ...@@ -320,16 +320,17 @@ __epm_repack_to_rpm()
true true
} }
# FIXME: Нужно как-то обеспечить непродолжение выполнения.
__epm_check_if_try_install_pkgtype() __epm_check_if_try_install_pkgtype()
{ {
local PKG="$1" local PKG="$1"
shift shift
__epm_split_by_pkg_type $PKG "$@" || return 1 __epm_split_by_pkg_type $PKG "$@" || return 1
__epm_repack_to_rpm $split_replaced_pkgs || fatal __epm_repack_to_rpm $split_replaced_pkgs || { RES=$? ; return 0 ; }
# TODO: move to install # TODO: move to install
docmd epm install $repacked_rpms docmd epm install $repacked_rpms
local RES=$? RES=$?
# TODO: move it to exit handler # TODO: move it to exit handler
if [ -z "$DEBUG" ] ; then if [ -z "$DEBUG" ] ; then
# TODO: reinvent # TODO: reinvent
...@@ -338,7 +339,7 @@ __epm_check_if_try_install_pkgtype() ...@@ -338,7 +339,7 @@ __epm_check_if_try_install_pkgtype()
[ -n "$to_remove_pkg_dirs" ] && rmdir $to_remove_pkg_dirs 2>/dev/null [ -n "$to_remove_pkg_dirs" ] && rmdir $to_remove_pkg_dirs 2>/dev/null
fi fi
return $RES return 0
} }
......
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