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=
non_interactive=$EPM_AUTO
download=
download_only=
print_url=
interactive=
force_yes=
skip_installed=
......@@ -480,6 +481,9 @@ check_option()
--download-only) # HELPOPT: download only the package/tarball (before any convertation)
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)
# TODO: how to read arg?
sort="$1"
......
......@@ -198,7 +198,7 @@ __epm_download_alt()
try_change_alt_repo
epm_addrepo "$@"
docmd epm download "$installlist"
docmd epm download $print_url "$installlist"
epm_removerepo "$@"
end_change_alt_repo
......@@ -209,6 +209,7 @@ __epm_download_alt()
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
echo "$(basename "$i")" | grep -q "^$pkg" || continue
[ -n "$print_url" ] && echo "$i" && continue
eget $i
done
done
......@@ -239,10 +240,14 @@ epm_download()
case $PMTYPE in
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 $*
;;
dnf-rpm)
sudocmd dnf download $*
sudocmd dnf download $print_url $*
;;
aptcyg)
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