epm-repolist 1.52 KB
Newer Older
1 2 3 4 5
#!/bin/sh
#
# Copyright (C) 2012  Etersoft
# Copyright (C) 2012  Vitaly Lipatov <lav@etersoft.ru>
#
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 35 36
	apt-rpm)
		docmd apt-repo list
		;;
37 38 39
	deepsolver-rpm)
		docmd ds-conf
		;;
40 41 42
	apt-dpkg)
		showcmd cat /etc/apt/sources.list*
		print_apt_sources_list /etc/apt/sources.list /etc/apt/sources.list.d/*.list
43
		;;
44
	yum-rpm)
45 46
		docmd yum repolist
		;;
47 48 49
	dnf-rpm)
		docmd dnf repolist -v
		;;
50
	urpm-rpm)
51
		docmd urpmq --list-url
52
		;;
53
	zypper-rpm)
54 55 56
		docmd zypper sl -d
		;;
	emerge)
57
		docmd layman -L
58 59
		;;
	pacman)
60
		docmd grep -v -- "^#\|^$" /etc/pacman.conf
61
		;;
62
	slackpkg)
63
		docmd grep -v -- "^#\|^$" /etc/slackpkg/mirrors
64
		;;
65 66 67 68 69 70
	*)
		fatal "Do not known command for $PMTYPE"
		;;
esac

}