epm-repolist 1.89 KB
Newer Older
1 2
#!/bin/sh
#
3 4
# Copyright (C) 2012, 2016, 2019, 2020  Etersoft
# Copyright (C) 2012, 2016, 2019, 2020  Vitaly Lipatov <lav@etersoft.ru>
5
#
6 7 8
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
9 10 11 12 13
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU Affero General Public License for more details.
15
#
16 17
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
18 19
#

20 21
load_helper epm-sh-altlinux

22 23
print_apt_sources_list()
{
24
    local i
25 26 27 28
    for i in $@ ; do
        test -r "$i" || continue
        #echo
        #echo "$i:"
29 30
        grep -v -- "^#" $i
    done | grep -v -- "^ *\$"
31 32
}

33 34 35
epm_repolist()
{
case $PMTYPE in
36
	apt-rpm)
37
		assure_exists apt-repo
38 39 40 41 42
		if tasknumber "$pkg_names" >/dev/null ; then
			get_task_packages $pkg_names
		else
			docmd apt-repo list
		fi
43
		;;
44 45 46
	deepsolver-rpm)
		docmd ds-conf
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
47
	apt-dpkg|aptitude-dpkg)
Vitaly Lipatov's avatar
Vitaly Lipatov committed
48
		showcmd cat /etc/apt/sources.list /etc/apt/sources.list.d/*.list
49
		print_apt_sources_list /etc/apt/sources.list /etc/apt/sources.list.d/*.list
50
		;;
51
	yum-rpm)
Vitaly Lipatov's avatar
Vitaly Lipatov committed
52
		docmd yum repolist -v
53
		;;
54 55 56
	dnf-rpm)
		docmd dnf repolist -v
		;;
57
	urpm-rpm)
58
		docmd urpmq --list-url
59
		;;
60
	zypper-rpm)
61 62
		docmd zypper sl -d
		;;
63
	packagekit)
64 65
		docmd pkcon repo-list
		;;
66
	emerge)
67
		docmd eselect profile list
68
		docmd layman -L
69
		;;
70 71 72
	xbps)
		docmd xbps-query -L
		;;
73 74 75
	winget)
		docmd winget source list
		;;
76
	pacman)
77
		docmd grep -v -- "^#\|^$" /etc/pacman.conf
78
		;;
79
	slackpkg)
80
		docmd grep -v -- "^#\|^$" /etc/slackpkg/mirrors
81
		;;
82
	*)
83
		fatal "Have no suitable command for $PMTYPE"
84 85 86 87
		;;
esac

}