Commit 19fb0f19 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-removerepo: fix remove repo status (warning about empty grep)

parent d4120392
...@@ -22,18 +22,17 @@ load_helper epm-sh-altlinux ...@@ -22,18 +22,17 @@ load_helper epm-sh-altlinux
# remove grepped lines # remove grepped lines
__epm_removerepo_alt_grepremove() __epm_removerepo_alt_grepremove()
{ {
local rp local rl
local flag=0 rl="$((quiet=1 epm repolist) 2>/dev/null | grep -E "$1")"
(quiet=1 epm repolist) 2>/dev/null | grep -E "$1" | while read rp ; do [ -z "$rl" ] && warning "Can't find '$1' in the repos (see '# epm repolist' output)" && return 1
[ -n "$dryrun" ] || apt-repo --dry-run rm "$rp" echo "$rl" | while read rp ; do
[ -n "$dryrun" ] && apt-repo --dry-run rm "$rp" && continue
if [ -n "$verbose" ] ; then if [ -n "$verbose" ] ; then
sudocmd apt-repo $dryrun rm "$rp" sudocmd apt-repo $dryrun rm "$rp"
else else
$SUDO apt-repo $dryrun rm "$rp" $SUDO apt-repo $dryrun rm "$rp"
fi fi
flag=1
done done
[ "$flag" = "0" ] && warning "Can't find '$1' in the repos (see 'epm repolist' output)"
} }
__epm_removerepo_alt() __epm_removerepo_alt()
......
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