Commit 3b92fde7 authored by Vitaly Lipatov's avatar Vitaly Lipatov

put urls to pkg_urls and download it if need

parent 2177e5c9
...@@ -80,6 +80,7 @@ show_command_only= ...@@ -80,6 +80,7 @@ show_command_only=
epm_cmd= epm_cmd=
pkg_files= pkg_files=
pkg_names= pkg_names=
pkg_urls=
quoted_args= quoted_args=
progname="${0##*/}" progname="${0##*/}"
...@@ -307,6 +308,8 @@ check_filenames() ...@@ -307,6 +308,8 @@ check_filenames()
# files can be with full path or have extension via . # files can be with full path or have extension via .
if [ -f "$opt" ] && echo "$opt" | grep -q "[/\.]" ; then if [ -f "$opt" ] && echo "$opt" | grep -q "[/\.]" ; then
pkg_files="$pkg_files $opt" pkg_files="$pkg_files $opt"
elif echo "$opt" | grep -q "://" ; then
pkg_urls="$pkg_names $opt"
else else
pkg_names="$pkg_names $opt" pkg_names="$pkg_names $opt"
fi fi
...@@ -334,6 +337,7 @@ fi ...@@ -334,6 +337,7 @@ fi
pkg_files=$(strip_spaces "$pkg_files") pkg_files=$(strip_spaces "$pkg_files")
pkg_names=$(strip_spaces "$pkg_names") pkg_names=$(strip_spaces "$pkg_names")
pkg_urls=$(strip_spaces "$pkg_urls")
pkg_filenames=$(strip_spaces "$pkg_files $pkg_names") pkg_filenames=$(strip_spaces "$pkg_files $pkg_names")
......
...@@ -81,6 +81,15 @@ __separate_sudocmd() ...@@ -81,6 +81,15 @@ __separate_sudocmd()
return 0 return 0
} }
download_pkg_urls()
{
local url
[ -z "$1" ] && return
for url in $* ; do
eget $url || warning "Skipped"
done
}
# copied from etersoft-build-utils/share/eterbuild/functions/rpmpkg # copied from etersoft-build-utils/share/eterbuild/functions/rpmpkg
epm_install_names() epm_install_names()
{ {
...@@ -389,6 +398,10 @@ epm_install() ...@@ -389,6 +398,10 @@ epm_install()
return return
fi fi
# Download urls via eget pkg_urls and use eget
# TODO: use optimization (rpm can download packages by url, yum too?)
download_pkg_urls "$pkg_urls"
[ -z "$pkg_files$pkg_names" ] && info "Skip empty install list" && return 22 [ -z "$pkg_files$pkg_names" ] && info "Skip empty install list" && return 22
local names="$(echo $pkg_names | filter_out_installed_packages)" local names="$(echo $pkg_names | filter_out_installed_packages)"
......
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