Commit 1d7e2436 authored by Vitaly Lipatov's avatar Vitaly Lipatov

backported to M60P as 0.9.5-alt0.M60P.1 (with rpmbph script)

parents b9a92202 b85d42d9
...@@ -64,6 +64,7 @@ quiet= ...@@ -64,6 +64,7 @@ quiet=
nodeps= nodeps=
non_interactive= non_interactive=
skip_installed= skip_installed=
show_command_only=
epm_cmd= epm_cmd=
pkg_files= pkg_files=
pkg_names= pkg_names=
...@@ -110,13 +111,13 @@ check_command() ...@@ -110,13 +111,13 @@ check_command()
-e|-P|remove|delete) # HELPCMD: remove (delete) package(s) from the database and the system -e|-P|remove|delete) # HELPCMD: remove (delete) package(s) from the database and the system
epm_cmd=remove epm_cmd=remove
;; ;;
-qi|info) # HELPCMD: print package detail info -qi|info|show) # HELPCMD: print package detail info
epm_cmd=info epm_cmd=info
;; ;;
clean) # HELPCMD: clean local package cache clean) # HELPCMD: clean local package cache
epm_cmd=clean epm_cmd=clean
;; ;;
-qa|list|packages) # HELPCMD: list of installed package(s) -qa|list|packages|-l) # HELPCMD: list of installed package(s)
epm_cmd=packages epm_cmd=packages
;; ;;
-qp|query_package) # HELPCMD: search in the list of installed packages -qp|query_package) # HELPCMD: search in the list of installed packages
...@@ -134,7 +135,7 @@ check_command() ...@@ -134,7 +135,7 @@ check_command()
-q|installed) # HELPCMD: check presence of package(s) -q|installed) # HELPCMD: check presence of package(s)
epm_cmd=query epm_cmd=query
;; ;;
-qf|which) # HELPCMD: query package(s) owning file -qf|which|belongs) # HELPCMD: query package(s) owning file
epm_cmd=query_file epm_cmd=query_file
;; ;;
filesearch) # HELPCMD: search in which package a file is included filesearch) # HELPCMD: search in which package a file is included
...@@ -152,7 +153,7 @@ check_command() ...@@ -152,7 +153,7 @@ check_command()
simulate) # HELPCMD: simulate install (check requires) simulate) # HELPCMD: simulate install (check requires)
epm_cmd=simulate epm_cmd=simulate
;; ;;
addrepo) # HELPCMD: add package repo addrepo|ar) # HELPCMD: add package repo
epm_cmd=addrepo epm_cmd=addrepo
;; ;;
repolist|sl) # HELPCMD: print repo list repolist|sl) # HELPCMD: print repo list
...@@ -182,6 +183,9 @@ for opt in "$@" ; do ...@@ -182,6 +183,9 @@ for opt in "$@" ; do
--skip-installed) # HELPOPT: skip already install during install --skip-installed) # HELPOPT: skip already install during install
skip_installed=1 skip_installed=1
;; ;;
--show-command-only) # HELPOPT: show command only, do not any action
show_command_only=1
;;
--quiet) # HELPOPT: quiet mode (do not print commands before exec) --quiet) # HELPOPT: quiet mode (do not print commands before exec)
quiet=1 quiet=1
;; ;;
......
...@@ -151,9 +151,38 @@ epm_install_files() ...@@ -151,9 +151,38 @@ epm_install_files()
epm_install_names $@ epm_install_names $@
} }
epm_print_install_command()
{
case $PMTYPE in
apt-rpm|yum-rpm|urpm-rpm|zypper-rpm)
echo "rpm -Uvh --force $nodeps $@"
;;
apt-dpkg)
echo "dpkg -i $@"
;;
pkg_add)
echo "pkg_add $@"
;;
pacman)
echo "pacman -U --noconfirm $@"
;;
slackpkg)
echo "installpkg $@"
;;
*)
fatal "Do not known appropriate install command for $PMTYPE"
;;
esac
}
epm_install() epm_install()
{ {
if [ -n "$show_command_only" ] ; then
epm_print_install_command $names
return
fi
[ -n "$pkg_files$pkg_names" ] || fatal "Run install without packages" [ -n "$pkg_files$pkg_names" ] || fatal "Run install without packages"
local names="$(echo $pkg_names | filter_out_installed_packages)" local names="$(echo $pkg_names | filter_out_installed_packages)"
......
...@@ -23,19 +23,13 @@ epm_packages() ...@@ -23,19 +23,13 @@ epm_packages()
case $PMTYPE in case $PMTYPE in
apt-rpm) apt-rpm)
CMD="rpm -qa" CMD="rpm -qa $pkg_filenames"
;; ;;
apt-dpkg) apt-dpkg)
CMD="dpkg -l" CMD="dpkg -l $pkg_filenames"
;; ;;
yum-rpm) yum-rpm|urpm-rpm|zypper-rpm)
CMD="rpm -qa" CMD="rpm -qa $pkg_filenames"
;;
urpm-rpm)
CMD="rpm -qa"
;;
zypper-rpm)
CMD="rpm -qa"
;; ;;
emerge) emerge)
CMD="qlist -I" CMD="qlist -I"
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
# #
# TODO: combine with -qa (the difference only in return status now)
epm_query() epm_query()
{ {
[ -n "$pkg_filenames" ] || fatal "Run query without names" [ -n "$pkg_filenames" ] || fatal "Run query without names"
...@@ -28,6 +30,10 @@ case $PMTYPE in ...@@ -28,6 +30,10 @@ case $PMTYPE in
;; ;;
apt-dpkg) apt-dpkg)
CMD="dpkg -l" CMD="dpkg -l"
# TODO: make rpm-like output
#showcmd dpkg -l $pkg_filenames
#dpkg -l $pkg_filenames | grep "^ii"
#return
;; ;;
*) *)
fatal "Do not known command for $PMTYPE" fatal "Do not known command for $PMTYPE"
......
...@@ -45,6 +45,20 @@ real_file() ...@@ -45,6 +45,20 @@ real_file()
FULLFILEPATH=`readlink -f $TOFILE` FULLFILEPATH=`readlink -f $TOFILE`
} }
dpkg_print_name_version()
{
local ver
for i in $* ; do
ver=$(dpkg -s $i 2>/dev/null | grep "Version:" | sed -e "s|Version: ||g")
if [ -z "$ver" ] ; then
echo "$i"
else
echo "$i-$ver"
fi
done
}
__do_query() __do_query()
{ {
case $PMTYPE in case $PMTYPE in
...@@ -52,8 +66,9 @@ __do_query() ...@@ -52,8 +66,9 @@ __do_query()
CMD="rpm -qf" CMD="rpm -qf"
;; ;;
apt-dpkg) apt-dpkg)
CMD="dpkg -S" showcmd dpkg -S $1
;; dpkg_print_name_version $(dpkg -S $1 | sed -e "s|:.*||")
return ;;
yum-rpm|urpm-rpm) yum-rpm|urpm-rpm)
CMD="rpm -qf" CMD="rpm -qf"
;; ;;
......
# This spec is backported to ALTLinux p6 automatically by rpmbph script. Do not edit it. # This spec is backported to ALTLinux p6 automatically by rpmbph script. Do not edit it.
# #
Name: eepm Name: eepm
Version: 0.9.4 Version: 0.9.5
Release: alt0.M60P.1 Release: alt0.M60P.1
Summary: Etersoft EPM package manager Summary: Etersoft EPM package manager
...@@ -47,9 +47,15 @@ with various distros. ...@@ -47,9 +47,15 @@ with various distros.
%_bindir/distr_info %_bindir/distr_info
%changelog %changelog
* Fri Aug 03 2012 Vitaly Lipatov <lav@altlinux.ru> 0.9.4-alt0.M60P.1 * Sat Aug 04 2012 Vitaly Lipatov <lav@altlinux.ru> 0.9.5-alt0.M60P.1
- backport to ALTLinux p6 (by rpmbph script) - backport to ALTLinux p6 (by rpmbph script)
* Sat Aug 04 2012 Vitaly Lipatov <lav@altlinux.ru> 0.9.5-alt1
- epm-install: add show-command-only support
- epm: update commands variations
- query_file: make output from dpkg like rpm -q
- epm-packages: allow filter list packages by one name
* Fri Aug 03 2012 Vitaly Lipatov <lav@altlinux.ru> 0.9.4-alt1 * Fri Aug 03 2012 Vitaly Lipatov <lav@altlinux.ru> 0.9.4-alt1
- add query package (-qp) support - add query package (-qp) support
- print command example in stderr - print command example in stderr
......
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