Commit ac481f27 authored by Vitaly Lipatov's avatar Vitaly Lipatov

improve commands

parent e1882cb0
......@@ -18,35 +18,25 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
#
# copied from korinf/tools/run-script/scripts/search
epm_clean()
{
[ -n "$pkg_filenames" ] || fatal "Run search without names"
case $DISTRNAME in
"ALTLinux"|"Ubuntu"|"Debian"|"PCLinux")
CMD="apt-get clean"
MASK="*.deb"
docmd $SUDO apt-get clean
;;
"LinuxXP"|"Fedora"|"ASPLinux"|"CentOS"|"RHEL"|"Scientific")
CMD="yum clean packages"
MASK="*.rpm"
docmd $SUDO yum clean all
docmd $SUDO yum makecache
;;
"Mandriva")
CMD="rm -f /var/cache/urpmi/rpms/*.rpm"
MASK="*.rpm"
docmd $SUDO urpmi --clean
;;
"SUSE")
CMD="zypper clean"
MASK="*.rpm"
docmd $SUDO zypper clean
;;
*)
RET=1
CMD="echo \"Do not known install command for DISTRNAME $DISTRNAME\""
fatal "Do not known command for $PMTYPE"
;;
esac
docmd $CMD $pkg_filenames
}
......@@ -35,6 +35,9 @@ epm_install_names()
zypper-rpm)
docmd $SUDO zypper install $@
return ;;
pkg_add)
docmd $SUDO pkg_add -r $@
return ;;
*)
fatal "Do not known install command for $PMTYPE"
;;
......@@ -57,6 +60,9 @@ epm_ni_install_names()
zypper-rpm)
yes | docmd $SUDO zypper --non-interactive install $@
return ;;
pkg_add)
docmd $SUDO pkg_add -r $@
return ;;
*)
fatal "Do not known appropriate install command for $PMTYPE"
;;
......@@ -75,6 +81,8 @@ epm_install_files()
ALTLinux|PCLinux)
docmd $SUDO apt-get install $@
return ;;
FreeBSD)
docmd $SUDO pkg_add $@
Ubuntu|Debian|Mint)
docmd $SUDO dpkg -i $@
docmd $SUDO apt-get -f install
......
......@@ -26,23 +26,22 @@ epm_query()
case $DISTRNAME in
"ALTLinux"|"PCLinux")
CMD="rpm -qa"
CMD="rpm -q"
;;
"Ubuntu"|"Debian")
CMD="dpkg -l"
;;
"LinuxXP"|"Fedora"|"ASPLinux"|"CentOS"|"RHEL"|"Scientific")
CMD="rpm -qa"
CMD="rpm -q"
;;
"Mandriva")
CMD="rpm -qa"
CMD="rpm -q"
;;
"SUSE")
CMD="rpm -qa"
CMD="rpm -q"
;;
*)
RET=1
CMD="echo \"Do not known query command for DISTRNAME $DISTRNAME\""
fatal "Do not known command for $PMTYPE"
;;
esac
......
......@@ -30,7 +30,10 @@ case $PMTYPE in
"apt-dpkg")
docmd $SUDO apt-get update || exit
docmd $SUDO apt-get -f install || exit
docmd $SUDO apt-get autoremove
#docmd $SUDO apt-get autoremove
;;
urpm-rpm)
docmd $SUDO urpmi.update -a
;;
# skip, will do it automagically
# "LinuxXP"|"Fedora"|"ASPLinux"|"CentOS"|"RHEL"|"Scientific")
......
......@@ -32,7 +32,8 @@ epm_upgrade()
CMD="yum update"
;;
urpm-rpm)
CMD="urpmi --auto-update"
# or --auto-update
CMD="urpmi --auto-select"
;;
zypper-rpm)
CMD="zypper update"
......
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