Commit 946c3c28 authored by Vitaly Lipatov's avatar Vitaly Lipatov

short fixes

parent a474ee57
2. Дописать таблицу на вики на основании реализованных команд.
3. Доделать и проверить deplist|requires
https://wiki.archlinux.org/index.php/Pacman_Rosetta
......@@ -128,7 +128,7 @@ check_command()
-i|install|add) # HELPCMD: install package(s) from remote repositories or from local file
epm_cmd=install
;;
-e|-P|remove|delete) # HELPCMD: remove (delete) package(s) from the database and the system
-e|-P|remove|delete|uninstall) # HELPCMD: remove (delete) package(s) from the database and the system
epm_cmd=remove
;;
-s|search) # HELPCMD: search in remote package repositories
......
......@@ -87,6 +87,7 @@ epm_install_names()
return ;;
npackd)
separate_installed $@
# FIXME: fix return status
# TODO: use upgrade if package is already installed
[ -n "$pkg_noninstalled" ] && sudocmd npackdcl add --package=$@ $pkg_noninstalled
[ -n "$pkg_installed" ] && sudocmd npackdcl update --package=$@ $pkg_installed
......@@ -106,6 +107,11 @@ epm_install_names()
[ -n "$force" ] && force=-force-depends
sudocmd ipkg $force install $@
return ;;
nix)
separate_installed $@
[ -n "$pkg_noninstalled" ] && sudocmd nix-env --install $pkg_noninstalled
[ -n "$pkg_installed" ] && sudocmd nix-env --upgrade $pkg_installed
return ;;
*)
fatal "Do not known install command for $PMTYPE"
;;
......@@ -133,6 +139,9 @@ epm_ni_install_names()
pkgsrc)
sudocmd pkg_add -r $@
return ;;
emerge)
sudocmd emerge -uD $@
return ;;
pacman)
sudocmd pacman -S --noconfirm $force $nodeps $@
return ;;
......@@ -149,9 +158,14 @@ epm_ni_install_names()
ipkg)
sudocmd ipkg -force-defaults install $@
return ;;
nix)
sudocmd nix-env --install $@
return ;;
slackpkg)
# TODO: use upgrade if package is already installed
sudocmd /usr/sbin/slackpkg -batch=on -default_answer=yes install $@
separate_installed $@
# FIXME: broken status when use batch and default answrt
[ -n "$pkg_noninstalled" ] && sudocmd /usr/sbin/slackpkg -batch=on -default_answer=yes install $pkg_noninstalled
[ -n "$pkg_installed" ] && sudocmd /usr/sbin/slackpkg -batch=on -default_answer=yes upgrade $pkg_installed
return ;;
*)
fatal "Do not known appropriate install command for $PMTYPE"
......@@ -239,6 +253,10 @@ epm_print_install_command()
pkgsrc)
echo "pkg_add $@"
;;
#emerge)
# # it is better to use epm
# echo "tar xvfj $@ -C /"
# ;;
pacman)
echo "pacman -U --noconfirm --force $nodeps $@"
;;
......@@ -265,7 +283,7 @@ epm_install()
return
fi
[ -n "$pkg_files$pkg_names" ] || fatal "Run install without packages"
[ -n "$pkg_files$pkg_names" ] || { echo "Skip empty install list" ; return 22 ; }
local names="$(echo $pkg_names | filter_out_installed_packages)"
local files="$(echo $pkg_files | filter_out_installed_packages)"
......
......@@ -57,6 +57,9 @@ case $PMTYPE in
# ;;
slackpkg)
CMD="ls -1 /var/log/packages/"
if [ -n "$short" ] ; then
docmd ls -1 /var/log/packages/ | sed -e "s|-[0-9].*||g"
return
;;
homebrew)
CMD="brew $pkg_filenames"
......
......@@ -55,6 +55,9 @@ case $PMTYPE in
# FIXME: use hi level commands
fi
;;
emerge)
CMD="equery files"
;;
# yum-rpm)
# CMD="yum deplist"
# ;;
......
......@@ -70,11 +70,12 @@ __epm_query_name()
CMD="rpm -q"
;;
apt-dpkg)
CMD="dpkg -l"
#docmd dpkg -l $@
docmd dpkg -l $@ | grep "^ii"
# TODO: make rpm-like output
#showcmd dpkg -l $pkg_filenames
#dpkg -l $pkg_filenames | grep "^ii"
#return
return
;;
npackd)
CMD="npackdcl path --package=$@"
......
......@@ -84,6 +84,9 @@ epm_remove_names()
npackd)
sudocmd npackdcl remove --package=$@
return ;;
nix)
sudocmd nix-env --uninstall $@
return ;;
chocolatey)
sudocmd chocolatey uninstall $@
return ;;
......
......@@ -27,6 +27,12 @@ case $PMTYPE in
apt-rpm|apt-dpkg)
CMD="apt-cache whatdepends"
;;
yum-rpm)
CMD="repoquery --whatrequires"
;;
emerge)
CMD="equery depends -a"
;;
*)
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