Commit 5ac2879e authored by Vitaly Lipatov's avatar Vitaly Lipatov

add commands: addrepo, removerepo, search_file, info, update some other

parent 35735b2b
1. Разобраться с поиском по локальным пакетам
2. Дописать таблицу на вики и по ней справку
4. Проверить, что в общем всё работает
6. rpmqf, если не найдёт в локальной базе, могла бы искать в глобальной
6. rpmqf, если не найдёт в локальной базе, могла бы искать в глобальной (search_file)
7. Дописать начатый reinstall (повторную установку), с --force при установке пакета
Отказаться от distr_vendor в rpm-build-altlinux-compat и использовать distr_info отсюда.
Replace rpmU with epmi
Возможность вывода/возврата команды, планируемой к выполнению
(префикс $OUTPUT перед всеми командами?)
test requies делать перед сборкой! :)
......@@ -123,10 +123,13 @@ check_command()
-qf|which) # HELPCMD: query package(s) owning file
epm_cmd=query_file
;;
filesearch) # HELPCMD: search in which package a file is included
epm_cmd=search_file
;;
-ql|filelist) # HELPCMD: print package file list
epm_cmd=filelist
;;
check|fix) # HELPCMD: check local package base integrity and fix it
check|fix|verify) # HELPCMD: check local package base integrity and fix it
epm_cmd=check
;;
checkpkg|integrity) # HELPCMD: check package integrity
......@@ -135,6 +138,9 @@ check_command()
simulate) # HELPCMD: simulate install (check requires)
epm_cmd=simulate
;;
addrepo) # HELPCMD: add package repo
epm_cmd=addrepo
;;
*)
return 1
esac
......
#!/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.
#
epm_addrepo()
{
case $PMTYPE in
#apt-rpm|apt-dpkg)
# docmd $SUDO apt-get check || exit
# ;;
#yum-rpm)
# docmd $SUDO yum repolist || exit
# ;;
urpm-rpm)
docmd $SUDO urpmi.addmedia --distrib $pkg_filenames
;;
zypper-rpm)
docmd $SUDO zypper ar $pkg_filenames || exit
;;
*)
fatal "Do not known command for $PMTYPE"
;;
esac
}
......@@ -33,6 +33,13 @@ case $PMTYPE in
docmd $SUDO apt-get -f install || exit
docmd $SUDO apt-get autoremove
;;
yum-rpm)
docmd package-cleanup --leaves
package-cleanup --leaves | xargs yum remove
;;
zypper-rpm)
docmd $SUDO zypper verify || exit
;;
*)
fatal "Do not known command for $PMTYPE"
;;
......
#!/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.
#
epm_info()
{
case $PMTYPE in
apt-rpm|apt-dpkg)
docmd apt-cache show || exit
;;
#yum-rpm)
# docmd $SUDO yum repolist || exit
# ;;
zypper-rpm)
docmd zypper info $pkg_names || exit
;;
*)
fatal "Do not known command for $PMTYPE"
;;
esac
}
......@@ -110,10 +110,17 @@ epm_install_files()
FreeBSD)
docmd $SUDO pkg_add $@
return ;;
Ubuntu|Debian|Mint)
esac
case $PMTYPE in
apt-dpkg)
docmd $SUDO dpkg -i $@
docmd $SUDO apt-get -f install
return ;;
yum-rpm)
docmd $SUDO rpm -Uvh --force $@ && return
docmd $SUDO yum --nogpgcheck local install $@
return ;;
esac
# other systems can install file package via ordinary command
......
#!/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.
#
epm_removerepo()
{
case $PMTYPE in
#apt-rpm|apt-dpkg)
# docmd $SUDO apt-get check || exit
# ;;
#yum-rpm)
# docmd $SUDO yum repolist || exit
# ;;
zypper-rpm)
docmd $SUDO zypper removerepo $pkg_names || exit
;;
*)
fatal "Do not known command for $PMTYPE"
;;
esac
}
#!/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.
#
epm_search_file()
{
[ -n "$pkg_filenames" ] || fatal "Run search without names"
case $PMTYPE in
apt-rpm|apt-dpkg)
docmd $SUDO apt-file update
docmd apt-file search $pkg_filenames
return ;;
yum-rpm)
fatal "TODO"
CMD="yum search"
;;
urpm-rpm)
CMD="urpmf"
;;
zupper-rpm)
CMD="zypper wp vi"
;;
*)
fatal "Do not known search file command for $PMTYPE"
;;
esac
docmd $CMD $pkg_filenames
}
......@@ -35,18 +35,9 @@ case $PMTYPE in
urpm-rpm)
docmd $SUDO urpmi.update -a
;;
# skip, will do it automagically
# "LinuxXP"|"Fedora"|"ASPLinux"|"CentOS"|"RHEL"|"Scientific")
# CMD="yum update"
# ;;
# "Mandriva")
# CMD="urpmf"
# ;;
# skip, will do it automagically
# "SUSE")
# CMD="zypper update"
# ;;
zypper-rpm)
docmd $SUDO zypper refresh
;;
*)
RET=1
echo \"Do not known install command for DISTRNAME $DISTRNAME\"
......
......@@ -32,11 +32,11 @@ epm_upgrade()
CMD="yum update"
;;
urpm-rpm)
# or --auto-update
CMD="urpmi --auto-select"
# or --auto-select
CMD="urpmi --auto-update --replace-files"
;;
zypper-rpm)
CMD="zypper update"
CMD="zypper dist-upgrade"
;;
*)
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