Commit 60fa1d8c authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-install: check if install by command

parent dc8f7abd
...@@ -290,6 +290,7 @@ __epm_check_if_src_rpm() ...@@ -290,6 +290,7 @@ __epm_check_if_src_rpm()
done done
} }
# FIXME: move this hack to epm-repack
__epm_check_if_needed_repack() __epm_check_if_needed_repack()
{ {
local pkgname="$(epm print name from "$1")" local pkgname="$(epm print name from "$1")"
...@@ -298,6 +299,11 @@ __epm_check_if_needed_repack() ...@@ -298,6 +299,11 @@ __epm_check_if_needed_repack()
warning "There is repack rule for $pkgname package. It is better install this package via 'epm --repack install' or 'epm play'." warning "There is repack rule for $pkgname package. It is better install this package via 'epm --repack install' or 'epm play'."
} }
__epm_if_command_path()
{
is_dirpath "$1" && rhas "$1" "bin/"
}
epm_install_files() epm_install_files()
{ {
local files="$@" local files="$@"
...@@ -309,32 +315,32 @@ epm_install_files() ...@@ -309,32 +315,32 @@ epm_install_files()
case "$DISTRNAME" in case "$DISTRNAME" in
ALTLinux|ALTServer) ALTLinux|ALTServer)
# do not use low-level for install by file path (f.i. epm install /usr/bin/git)
if __epm_if_command_path $files ; then
epm_install_names $files
return
fi
# on ALT install target can be a real path
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
__epm_check_if_src_rpm $files __epm_check_if_src_rpm $files
# do not use low-level for install by file path (FIXME: reasons?) if [ -z "$repacked_pkgs" ] ; then
if ! is_dirpath "$files" || [ "$(get_package_type "$files")" = "rpm" ] ; then __epm_check_vendor $files
if [ -z "$repacked_pkgs" ] ; then __epm_check_if_needed_repack $files
__epm_check_vendor $files fi
__epm_check_if_needed_repack $files
fi sudocmd rpm -Uvh $force $noscripts $nodeps $files && save_installed_packages $files && return
sudocmd rpm -Uvh $force $noscripts $nodeps $files && save_installed_packages $files && return local RES=$?
local RES=$? # TODO: check rpm result code and convert it to compatible format if possible
# TODO: check rpm result code and convert it to compatible format if possible __epm_check_if_rpm_already_installed $files && return
__epm_check_if_rpm_already_installed $files && return
# if run with --nodeps, do not fallback on hi level # if run with --nodeps, do not fallback on hi level
[ -n "$nodeps" ] && return $RES [ -n "$nodeps" ] && return $RES
fi
epm_install_names $files
return
;; ;;
esac esac
......
...@@ -42,7 +42,7 @@ __epm_split_by_pkg_type() ...@@ -42,7 +42,7 @@ __epm_split_by_pkg_type()
__epm_repack_to_deb() __epm_repack_to_deb()
{ {
local pkg local pkg
local rpmpkgs="$1" local pkgs="$@"
assure_exists alien assure_exists alien
assure_exists fakeroot assure_exists fakeroot
...@@ -52,7 +52,7 @@ __epm_repack_to_deb() ...@@ -52,7 +52,7 @@ __epm_repack_to_deb()
local TDIR=$(mktemp -d) local TDIR=$(mktemp -d)
for pkg in $rpmpkgs ; do for pkg in $pkgs ; do
abspkg="$(realpath "$pkg")" abspkg="$(realpath "$pkg")"
info "Repacking $abspkg to local deb format ..." info "Repacking $abspkg to local deb format ..."
......
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