Commit 31dc9aa8 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add missed command for Gentoo, Slackware, FreeBSD

improve repo management commands
parent 3e28382e
......@@ -21,17 +21,26 @@
epm_addrepo()
{
case $PMTYPE in
#apt-rpm|apt-dpkg)
# docmd $SUDO apt-get check || exit
# ;;
#yum-rpm)
# docmd $SUDO yum repolist || exit
# ;;
apt-rpm|apt-dpkg)
echo "You need manually add repo to /etc/apt/sources.list"
;;
yum-rpm)
echo "You need manually add repo to /etc/yum.repos.d/"
;;
urpm-rpm)
docmd $SUDO urpmi.addmedia --distrib $pkg_filenames
docmd $SUDO urpmi.addmedia $pkg_filenames
;;
zypper-rpm)
docmd $SUDO zypper ar $pkg_filenames || exit
docmd $SUDO zypper ar $pkg_filenames
;;
emerge)
docmd $SUDO layman -a $pkg_filenames
;;
pacman)
echo "You need manually add repo to /etc/pacman.conf"
;;
pkgtool)
echo "You need manually add repo to /etc/slackpkg/mirrors"
;;
*)
fatal "Do not known command for $PMTYPE"
......
......@@ -33,6 +33,9 @@ case $PMTYPE in
pacman)
docmd pacman -Si $pkg_names
;;
pkgtool)
docmd slackpkg info $pkg_names
;;
*)
fatal "Do not known command for $PMTYPE"
;;
......
......@@ -39,9 +39,18 @@ case $PMTYPE in
zypper-rpm)
CMD="rpm -qa"
;;
emerge)
CMD="qlist -I"
;;
pkg_add)
CMD="pkg_info"
;;
pacman)
CMD="pacman -Qs"
;;
pkgtool)
CMD="ls -1 /var/log/packages/"
;;
*)
fatal "Do not known query command for $PMTYPE"
;;
......
......@@ -61,6 +61,9 @@ __do_query()
zypper-rpm)
CMD="rpm -qf"
;;
emerge)
CMD="equery belongs"
;;
pacman)
CMD="pacman -Qo"
;;
......
......@@ -41,26 +41,25 @@ epm_reinstall_names()
pacman)
docmd $SUDO pacman -U $@
return ;;
pkgtool)
docmd $SUDO slackpkg reinstall $@
return ;;
*)
fatal "Do not known install command for $PMTYPE"
;;
esac
}
# for low level install
#is_alt && FANCYPERCENT=--fancypercent
#docmd $SUDO rpm -Uvh $FANCYPERCENT "$@"
epm_reinstall_files()
{
[ -z "$1" ] && return
case $DISTRNAME in
ALTLinux|PCLinux)
case $PMTYPE in
apt-rpm)
docmd $SUDO rpm -Uvh --force $@ && return
docmd $SUDO apt-get --reinstall install $@
return ;;
Ubuntu|Debian|Mint)
apt-pkg)
docmd $SUDO dpkg -i $@
return ;;
esac
......
......@@ -76,7 +76,8 @@ epm_remove_names()
docmd $SUDO pkg_delete $@
return ;;
emerge)
docmd $SUDO emerge --unmerge $@
#docmd $SUDO emerge --unmerge $@
docmd $SUDO emerge -aC $@
return ;;
pacman)
docmd $SUDO pacman -R $@
......
......@@ -21,14 +21,26 @@
epm_removerepo()
{
case $PMTYPE in
#apt-rpm|apt-dpkg)
# docmd $SUDO apt-get check || exit
# ;;
#yum-rpm)
# docmd $SUDO yum repolist || exit
# ;;
apt-rpm|apt-dpkg)
echo "You need remove repo from /etc/apt/sources.list"
;;
yum-rpm)
echo "You need remove repo from /etc/yum.repos.d/"
;;
urpm-rpm)
docmd $SUDO urpmi.removemedia $pkg_names
;;
zypper-rpm)
docmd $SUDO zypper removerepo $pkg_names || exit
docmd $SUDO zypper removerepo $pkg_names
;;
emerge)
docmd $SUDO layman -d$pkg_names
;;
pacman)
echo "You need remove repo from /etc/pacman.conf"
;;
pkgtool)
echo "You need remove repo from /etc/slackpkg/mirrors"
;;
*)
fatal "Do not known command for $PMTYPE"
......
......@@ -18,17 +18,39 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
#
print_apt_sources_list()
{
for i in $@ ; do
test -r "$i" || continue
#echo
#echo "$i:"
grep -v "^#" $i
done | grep -v "^$"
}
epm_repolist()
{
case $PMTYPE in
#apt-rpm|apt-dpkg)
# docmd $SUDO apt-get check || exit
# ;;
apt-rpm|apt-dpkg)
docmd print_apt_sources_list /etc/apt/sources.list /etc/apt/sources.list.d/*
;;
yum-rpm)
docmd $SUDO yum repolist
docmd yum repolist
;;
urpm-rpm)
docmd urpmq --list-media
;;
zypper-rpm)
docmd $USDO zypper sl -d
docmd zypper sl -d
;;
emerge)
docmd layman -L
;;
pacman)
docmd cat /etc/pacman.conf
;;
pkgtool)
docmd cat /etc/slackpkg/mirrors
;;
*)
fatal "Do not known command for $PMTYPE"
......
......@@ -28,15 +28,17 @@ case $PMTYPE in
docmd apt-file search $pkg_filenames
return ;;
yum-rpm)
fatal "TODO"
CMD="yum search"
CMD="yum provides"
;;
urpm-rpm)
CMD="urpmf"
;;
zupper-rpm)
zypper-rpm)
CMD="zypper wp vi"
;;
pacman)
CMD="pacman -Qo"
;;
*)
fatal "Do not known search file command for $PMTYPE"
;;
......
......@@ -23,15 +23,18 @@
epm_update()
{
case $PMTYPE in
"apt-rpm")
apt-rpm)
docmd $SUDO apt-get update || exit
#docmd $SUDO apt-get -f install || exit
;;
"apt-dpkg")
apt-dpkg)
docmd $SUDO apt-get update || exit
#docmd $SUDO apt-get -f install || exit
#docmd $SUDO apt-get autoremove
;;
yum-rpm)
docmd $SUDO yum check-update
;;
urpm-rpm)
docmd $SUDO urpmi.update -a
;;
......@@ -41,10 +44,14 @@ case $PMTYPE in
zypper-rpm)
docmd $SUDO zypper refresh
;;
emerge)
docmd $SUDO emerge --sync
;;
pkgtool)
docmd $SUDO slackpkg update
;;
*)
RET=1
echo \"Do not known install command for DISTRNAME $DISTRNAME\"
exit 1
fatal "Do not known update command for $PMTYPE"
;;
esac
......
......@@ -39,7 +39,16 @@ epm_upgrade()
CMD="zypper dist-upgrade"
;;
pacman)
CMD="zypper -S -u"
CMD="pacman -S -u"
;;
emerge)
CMD="emerge -NuDa world"
;;
pkg_add)
CMD="freebsd-update fetch install"
;;
pkgtool)
CMD="slackpkg upgrade-all"
;;
*)
fatal "Do not known command for $PMTYPE"
......
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