Commit 6f75ae4b authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-removerepo: fix removing all repos, cleanup

parent 6f5e8d23
......@@ -47,6 +47,10 @@ __epm_removerepo_apt()
__epm_grep_repo_list()
{
if [ "$1" = "all" ] ; then
epm --quiet repo list
return
fi
while [ -n "$1" ] ; do
epm --quiet repo list "$1"
shift
......@@ -56,19 +60,12 @@ __epm_grep_repo_list()
# remove grepped lines
__epm_removerepo_alt_grepremove()
{
local rl="$*"
if [ "$rl" = "all" ] ; then
rl="*"
fi
local rl
# ^rpm means full string
if ! rhas "$rl" "^rpm" ; then
rl="$(__epm_grep_repo_list $rl 2>/dev/null)"
if [ -z "$rl" ] ; then
[ -n "$verbose" ] && warning 'Can'\''t find '$*' in the repos (see # epm repolist output)'
return 1
fi
rl="$(__epm_grep_repo_list "$@" 2>/dev/null)"
if [ -z "$rl" ] ; then
[ -n "$verbose" ] && warning 'Can'\''t find '$*' in the repos list (see # epm repolist output)'
return 1
fi
echo "$rl" | while read rp ; do
......@@ -118,6 +115,10 @@ __epm_removerepo_alt()
shift
__epm_removerepo_alt_grepremove " repo/$1/" "/tasks/$1 " "/$1[ /]build/repo"
;;
all)
info "removing all repos"
__epm_removerepo_alt_grepremove "all"
;;
-*)
fatal "epm removerepo: no options are supported"
;;
......
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