Commit 05a0a825 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-removerepo: improve __epm_removerepo_apt to support dryrun and quiet

parent 4df9272d
......@@ -23,11 +23,21 @@ load_helper epm-sh-altlinux
# like apt-add-repository --remove on deb systems
__epm_removerepo_apt()
{
[ -n "$*" ] || fatal "empty repo name"
local repo="$*"
[ -n "$repo" ] || fatal "empty repo name"
if [ -n "$dryrun" ] ; then
echo "$repo"
return
fi
local sc="sudocmd"
[ -z "$quiet" ] || sc="sudorun"
# aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for AstraLinuxCE/orel
sudocmd sed -i -e "s|.*$*.*||" /etc/apt/sources.list
$sc sed -i -e "s|.*$repo.*||" /etc/apt/sources.list
if [ -d /etc/apt/sources.list.d ] && ls /etc/apt/sources.list.d/*.list >/dev/null 2>/dev/null ; then
sudocmd sed -i -e "s|.*$*.*||" /etc/apt/sources.list.d/*.list
$sc sed -i -e "s|.*$repo.*||" /etc/apt/sources.list.d/*.list
fi
}
......
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