Commit 500f16e5 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm: add support for a few tasks in addrepo/removerepo/install

parent f78e46eb
......@@ -94,7 +94,7 @@ __epm_addrepo_altlinux()
assure_exists apt-repo
if tasknumber "$repo" >/dev/null ; then
sudocmd apt-repo add $(tasknumber "$repo")
sudocmd_foreach 'apt-repo add' $(tasknumber "$repo")
return
fi
......@@ -118,7 +118,7 @@ local repo="$(eval echo "$quoted_args")"
case $DISTRNAME in
ALTLinux)
__epm_addrepo_altlinux $repo
__epm_addrepo_altlinux $pkg_names
return
;;
esac
......
......@@ -538,14 +538,12 @@ epm_print_install_names_command()
epm_install()
{
if tasknumber "$pkg_names" >/dev/null ; then
assure_distr ALTLinux "install with task number"
assure_exists apt-repo
local task
for task in $(tasknumber "$pkg_names") ; do
sudocmd apt-repo test $task
done
return
if [ "$DISTRNAME" = "ALTLinux" ] ; then
if tasknumber "$pkg_names" >/dev/null ; then
assure_exists apt-repo
sudocmd_foreach "apt-repo test" "$(tasknumber $pkg_names)"
return
fi
fi
if [ -n "$show_command_only" ] ; then
......
......@@ -25,6 +25,7 @@ local repo="$(eval echo $quoted_args)"
case $DISTRNAME in
ALTLinux)
assure_exists apt-repo
case "$repo" in
autoimports)
info "remove autoimports repo"
......@@ -49,14 +50,24 @@ case $DISTRNAME in
;;
*)
if tasknumber "$repo" >/dev/null ; then
repo="$(epm repolist | grep "repo/$(tasknumber "$repo")" | line)"
# "
#sudocmd apt-repo rm all tasks
#return
local tn
for tn in $(tasknumber "$repo") ; do
repoline="$(epm repolist | grep " repo/$tn/" | line)" #"
[ -n "$repoline" ] || { info "Can't find $tn task in the repository list" ; continue ; }
sudocmd apt-repo rm "$repoline"
# try again to remove possible x86_64-i586
repoline="$(epm repolist | grep " repo/$tn/" | line)" #"
[ -n "$repoline" ] || continue
sudocmd apt-repo rm "$repoline"
done
return 0
fi
;;
esac
[ -n "$repo" ] || fatal "No such repo or task. Use epm remove repo [autoimports|archive|tasks/TASKNUMBER]"
assure_exists apt-repo
sudocmd apt-repo rm "$repo"
return
;;
......
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