3
# Copyright (C) 2023 Etersoft
4
# Copyright (C) 2023 Vitaly Lipatov <lav@etersoft.ru>
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU Affero General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU Affero General Public License for more details.
16
# You should have received a copy of the GNU Affero General Public License
17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
load_helper epm-sh-altlinux
21
#load_helper epm-repolist
23
alt_LISTS='/etc/apt/sources.list /etc/apt/sources.list.d/*.list'
26
__epm_repodisable_alt()
29
# ^rpm means full string
30
if rhas "$1" "\^rpm" ; then
31
rl="$(echo "$1" | sed -e 's|\^||')"
33
rl="$( (epm --quiet repolist) 2>/dev/null | grep -F "$1" | head -n1 )"
34
[ -z "$rl" ] && warning "Can't find '$1' entries in the repos (see '# epm repolist' output)" && return 1
36
echo "$rl" | while read rp ; do
37
[ -n "$dryrun" ] && echo "will comment $rp" && continue
38
sed -i -e "s|^\($(sed_escape "$rl")\)|#\1|" $alt_LISTS
49
__epm_repodisable_alt "$@"
51
apt-dpkg|aptitude-dpkg)
52
print_apt_sources_list
55
docmd yum repolist $verbose
56
[ -n "$verbose" ] || info "Use --verbose if you need detail information."
59
sudocmd dnf config-manager --enable $verbose "$@"
62
docmd eoget disable-repo "$@"
65
fatal "Have no suitable command for $PMTYPE"