Commit f7fd77ae authored by Vitaly Lipatov's avatar Vitaly Lipatov

add epm download --url for apt-rpm and apt-dpkg systems

parent eb240ebb
...@@ -108,6 +108,7 @@ sort= ...@@ -108,6 +108,7 @@ sort=
non_interactive=$EPM_AUTO non_interactive=$EPM_AUTO
download= download=
download_only= download_only=
print_url=
interactive= interactive=
force_yes= force_yes=
skip_installed= skip_installed=
...@@ -480,6 +481,9 @@ check_option() ...@@ -480,6 +481,9 @@ check_option()
--download-only) # HELPOPT: download only the package/tarball (before any convertation) --download-only) # HELPOPT: download only the package/tarball (before any convertation)
download_only="--download-only" download_only="--download-only"
;; ;;
--url) # HELPOPT: print only URL instead of download package
print_url="--url"
;;
--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"
......
...@@ -198,7 +198,7 @@ __epm_download_alt() ...@@ -198,7 +198,7 @@ __epm_download_alt()
try_change_alt_repo try_change_alt_repo
epm_addrepo "$@" epm_addrepo "$@"
docmd epm download "$installlist" docmd epm download $print_url "$installlist"
epm_removerepo "$@" epm_removerepo "$@"
end_change_alt_repo end_change_alt_repo
...@@ -209,6 +209,7 @@ __epm_download_alt() ...@@ -209,6 +209,7 @@ __epm_download_alt()
for pkg in "$@" ; do for pkg in "$@" ; do
for i in $(sudocmd apt-get install -y --print-uris --reinstall "$pkg" | cut -f1 -d " " | grep ".rpm'$" | sed -e "s|^'||" -e "s|'$||") ; do for i in $(sudocmd apt-get install -y --print-uris --reinstall "$pkg" | cut -f1 -d " " | grep ".rpm'$" | sed -e "s|^'||" -e "s|'$||") ; do
echo "$(basename "$i")" | grep -q "^$pkg" || continue echo "$(basename "$i")" | grep -q "^$pkg" || continue
[ -n "$print_url" ] && echo "$i" && continue
eget $i eget $i
done done
done done
...@@ -239,10 +240,14 @@ epm_download() ...@@ -239,10 +240,14 @@ epm_download()
case $PMTYPE in case $PMTYPE in
apt-dpkg) apt-dpkg)
if [ -n "$print_url" ] ; then
docmd apt-get download --print-uris $* | cut -f1 -d " " | grep ".deb'$" | sed -e "s|^'||" -e "s|'$||"
return
fi
docmd apt-get download $* docmd apt-get download $*
;; ;;
dnf-rpm) dnf-rpm)
sudocmd dnf download $* sudocmd dnf download $print_url $*
;; ;;
aptcyg) aptcyg)
sudocmd apt-cyg download $* sudocmd apt-cyg download $*
......
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