Commit ac481f27 authored by Vitaly Lipatov's avatar Vitaly Lipatov

improve commands

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