Commit 58e5f64f authored by Vitaly Lipatov's avatar Vitaly Lipatov

add reinstall

parent c8aeabe7
......@@ -4,6 +4,7 @@
4. Проверить, что в общем всё работает
5. Там, где нужно, добавить $SUDO
6. rpmqf, если не найдёт в локальной базе, могла бы искать в глобальной
7. Дописать начатый reinstall (повторную установку), с --force при установке пакета
Отказаться от distr_vendor в rpm-build-altlinux-compat и использовать distr_info отсюда.
......
......@@ -99,6 +99,9 @@ for opt in "$@" ; do
-i|install|add) # HELPCMD: install package(s) from remote repositories or from local file
epm_cmd=install
;;
reinstall) # HELPCMD: reinstall package(s) from remote repositories or from local file
epm_cmd=reinstall
;;
-e|-P|remove|delete) # HELPCMD: remove (delete) package(s) from the database and the system
epm_cmd=remove
;;
......
#!/bin/sh
#
# Copyright (C) 2012 Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru>
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (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
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
#
# copied from etersoft-build-utils/share/eterbuild/functions/rpmpkg
epm_reinstall_names()
{
[ -n "$1" ] || return
case $PMTYPE in
apt-rpm|apt-dpkg)
docmd $SUDO apt-get --reinstall install $@
return ;;
yum-rpm)
docmd $SUDO yum install $@
return ;;
urpm-rpm)
docmd $SUDO urpmi $@
return ;;
zypper-rpm)
docmd $SUDO zypper install $@
return ;;
pkg_add)
docmd $SUDO pkg_add -r $@
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)
docmd $SUDO rpm -Uvh --force $@
return ;;
Ubuntu|Debian|Mint)
docmd $SUDO dpkg -i $@
return ;;
esac
# other systems can install file package via ordinary command
epm_reinstall_names $@
}
epm_reinstall()
{
[ -n "$pkg_filenames" ] || fatal "Run install without packages"
epm_reinstall_names $pkg_names
epm_reinstall_files $pkg_files
}
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