epm-repolist 1.72 KB
Newer Older
1 2
#!/bin/sh
#
3 4
# Copyright (C) 2012, 2016, 2019  Etersoft
# Copyright (C) 2012, 2016, 2019  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
print_apt_sources_list()
{
22
    local i
23 24 25 26
    for i in $@ ; do
        test -r "$i" || continue
        #echo
        #echo "$i:"
27 28
        grep -v -- "^#" $i
    done | grep -v -- "^ *\$"
29 30
}

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

}