Commit 287526af authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-download: realize download via info from packages.altlinux.org

parent 5eb8ef63
......@@ -98,11 +98,37 @@ __handle_pkg_urls_to_checking()
# rm -fv $to_remove_pkg_files
#}
__epm_get_altpkg_url()
{
info "TODO: https://packages.altlinux.org/api/branches"
load_helper epm-site
local arch=$(paoapi packages/$1 | get_pao_var arch)
# FIXME: arch can be list
[ "$arch" = "noarch" ] || arch=$(arch)
# HACK: filename can be list
local filename=$(paoapi packages/$1 | get_pao_var filename | grep $arch)
# fixme: get from /branches
local dv=$DISTRNAME/$DISTRVERSION/branch
[ "$DISTRVERSION" = "Sisyphus" ] && dv=$DISTRNAME/$DISTRVERSION
echo "http://ftp.basealt.ru/pub/distributions/$dv/$arch/RPMS.classic/$filename"
}
epm_download()
{
local CMD
case $DISTRNAME in
ALTLinux)
local pkg
for pkg in $pkg_filenames ; do
local url=$(__epm_get_altpkg_url $pkg)
[ -n "$url" ] || warning "Can't get url for $pkg"
docmd eget $url
done
return
;;
esac
case $PMTYPE in
dnf-rpm)
sudocmd dnf download $pkg_filenames
......
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