Commit 42493910 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-install: add direct install (not via apt) support for ALT Linux

parent 287526af
...@@ -80,6 +80,7 @@ nodeps= ...@@ -80,6 +80,7 @@ nodeps=
noremove= noremove=
force= force=
short= short=
direct=
sort= sort=
non_interactive= non_interactive=
skip_installed= skip_installed=
...@@ -335,6 +336,9 @@ check_option() ...@@ -335,6 +336,9 @@ check_option()
--short) # HELPOPT: short output (just 'package' instead 'package-version-release') --short) # HELPOPT: short output (just 'package' instead 'package-version-release')
short="--short" short="--short"
;; ;;
--direct) # HELPOPT: direct install package file from ftp (not via hilevel repository manager)
direct="--direct"
;;
--sort) # HELPOPT: sort output, f.i. --sort=size (supported only for packages command) --sort) # HELPOPT: sort output, f.i. --sort=size (supported only for packages command)
# TODO: how to read arg? # TODO: how to read arg?
sort="$1" sort="$1"
......
...@@ -323,6 +323,23 @@ __epm_check_if_try_install_rpm() ...@@ -323,6 +323,23 @@ __epm_check_if_try_install_rpm()
return 0 return 0
} }
__handle_direct_install()
{
case "$DISTRNAME" in
"ALTLinux")
load_helper epm-download
local pkg url
for pkg in $pkg_names ; do
url=$(__epm_get_altpkg_url $pkg)
[ -n "$url" ] || continue
# TODO: use estrlist
pkg_urls="$pkg_urls $url"
done
# FIXME: need remove
pkg_names=""
;;
esac
}
epm_install_files() epm_install_files()
{ {
...@@ -514,6 +531,10 @@ epm_install() ...@@ -514,6 +531,10 @@ epm_install()
return return
fi fi
if [ -n "$direct" ] ; then
__handle_direct_install
fi
# if possible, it will put pkg_urls into pkg_files or pkg_names # if possible, it will put pkg_urls into pkg_files or pkg_names
if [ -n "$pkg_urls" ] ; then if [ -n "$pkg_urls" ] ; then
load_helper epm-download load_helper epm-download
...@@ -527,7 +548,7 @@ epm_install() ...@@ -527,7 +548,7 @@ epm_install()
[ -z "$files$names" ] && info "Skip empty install list" && return 22 [ -z "$files$names" ] && info "Skip empty install list" && return 22
if [ -z "$files" ] ; then if [ -z "$files" ] && [ -z "$direct" ] ; then
# it is useful for first time running # it is useful for first time running
update_repo_if_needed update_repo_if_needed
fi fi
......
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