Commit eb4679db authored by Vitaly Lipatov's avatar Vitaly Lipatov

rewrite get_task_packages without apt-repo

parent 5923d87d
......@@ -220,7 +220,6 @@ __epm_download_alt()
load_helper epm-Install
local installlist="$(get_task_packages $*)"
# hack: drop -devel packages to avoid package provided by multiple packages
installlist="$(estrlist reg_exclude ".*-devel .*-devel-static .*-checkinstall .*-debuginfo" "$installlist")"
[ -n "$verbose" ] && info 'Packages from task(s): $installlist'
......
......@@ -319,7 +319,6 @@ epm_remove()
if [ "$BASEDISTRNAME" = "alt" ] ; then
load_helper epm-sh-altlinux
if tasknumber "$pkg_names" >/dev/null ; then
assure_exists apt-repo
pkg_names="$(get_task_packages $pkg_names)"
fi
fi
......
......@@ -103,12 +103,11 @@ epm_repolist()
case $PMTYPE in
apt-rpm)
#assure_exists apt-repo
if tasknumber "$1" >/dev/null ; then
# FIXME: unexpectedly, a list of packages instead of repositories.
get_task_packages "$@"
else
print_apt_sources_list "$@"
#docmd apt-repo list
fi
;;
deepsolver-rpm)
......
#!/bin/sh
#
# Copyright (C) 2014, 2017, 2021 Etersoft
# Copyright (C) 2014, 2017, 2021 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2014, 2017, 2021, 2025 Etersoft
# Copyright (C) 2014, 2017, 2021, 2025 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
......@@ -23,16 +23,37 @@ tasknumber()
isnumber "$num" && echo "$*"
}
# todo: improve apt-repo
get_task_arepo_packages()
ALTTASKURL="http://git.altlinux.org/tasks"
get_task_status()
{
local tn="$1"
docmd eget --check-url $ALTTASKURL/$tn/plan/add-bin
}
get_task_arepo_status()
{
local tn="$1"
docmd eget --check-url $ALTTASKURL/$tn/plan/arepo-add-x86_64-i586
}
get_task_packages_list()
{
local tn="$1"
local res
showcmd "eget -q -O- $ALTTASKURL/$tn/plan/add-bin"
res="$(eget -q -O- $ALTTASKURL/$tn/plan/add-bin)" || return
echo "$res" | cut -f1-3 | grep -E "(noarch|$DISTRARCH)$" | cut -f1
}
get_task_arepo_packages_list()
{
local tn="$1"
local res
assure_exists apt-repo
info "TODO: please, improve apt-repo to support arepo (i586-) packages for apt-repo list task"
showcmd "eget -q -O- http://git.altlinux.org/tasks/$tn/plan/arepo-add-x86_64-i586 | cut -f1"
# TODO: retrieve one time
res="$(eget -q -O- http://git.altlinux.org/tasks/$tn/plan/arepo-add-x86_64-i586 2>/dev/null)" || return #{ warning "There is a download error for x86_64-i586 arepo." ; return ; }
showcmd "eget -q -O- $ALTTASKURL/$tn/plan/arepo-add-x86_64-i586"
res="$(eget -q -O- $ALTTASKURL/$tn/plan/arepo-add-x86_64-i586)" || return
echo "$res" | cut -f1
}
......@@ -41,9 +62,10 @@ get_task_packages()
{
local tn
for tn in $(tasknumber "$@") ; do
showcmd apt-repo list task "$tn"
a='' apt-repo list task "$tn" >/dev/null || continue
a='' apt-repo list task "$tn"
[ "$DISTRARCH" = "x86_64" ] && get_task_arepo_packages "$tn"
get_task_status "$tn" || continue
get_task_packages_list "$tn"
[ "$DISTRARCH" = "x86_64" ] || continue
get_task_arepo_status "$tn" || continue
get_task_arepo_packages_list "$tn"
done
}
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