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