Commit 247aa264 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm: improve apm support

parent e5a423a1
......@@ -51,7 +51,7 @@ __epm_changelog_local_names()
[ -z "$*" ] && return
case $PMTYPE in
apt-rpm|yum-rpm|dnf-rpm|dnf5-rpm|urpm-rpm|zypper-rpm)
*-rpm)
docmd_foreach "rpm -q --changelog" $@
;;
apt-dpkg|aptitude-dpkg)
......
......@@ -18,7 +18,7 @@
#
EHOG='\(apt-get\|rpm\)'
JCHAN='-t apt-get -t rpm'
JCHAN='-t apt-get -t rpm -t apm'
__alt_epm_history_journal()
{
......@@ -112,7 +112,7 @@ Examples:
epm_history()
{
if [ $PMTYPE = "apt-rpm" ] ; then
if [ $PMTYPE = "apt-rpm" ] || [ $PMTYPE = "apm-rpm" ] ; then
case "$1" in
"-h"|"--help"|"help") # HELPCMD: help
epm_history_help
......
......@@ -60,7 +60,7 @@ case $PMTYPE in
if [ -n "$direct" ] ; then
__epm_info_rpm_low && return
fi
docmd apm system info $pkg_names
docmd apm system info $full $pkg_names
;;
aptitude-dpkg)
if [ -n "$pkg_files" ] ; then
......
......@@ -273,6 +273,9 @@ epm_ni_install_names()
apt-dpkg)
sudocmd env ACCEPT_EULA=y DEBIAN_FRONTEND=noninteractive apt-get -y $noremove --force-yes -o APT::Install::VirtualVersion=true -o APT::Install::Virtual=true -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" $APTOPTIONS install $@
return ;;
apm-rpm)
sudocmd apm system install $@
return ;;
aptitude-dpkg)
sudocmd env ACCEPT_EULA=y DEBIAN_FRONTEND=noninteractive aptitude -y install $@
return ;;
......
......@@ -100,6 +100,9 @@ epm_print_install_names_command()
# this command not for complex use. ACCEPT_EULA=y DEBIAN_FRONTEND=noninteractive
echo "apt-get -y --force-yes -o APT::Install::VirtualVersion=true -o APT::Install::Virtual=true $APTOPTIONS install $*"
return ;;
apm-rpm)
echo "apm system install $*"
return ;;
aptitude-dpkg)
echo "aptitude -y install $*"
return ;;
......
......@@ -71,6 +71,17 @@ case $PMTYPE in
return
fi
;;
apm-rpm)
# FIXME: need fix for a few names case
# TODO: separate this function to two section
if is_installed $pkg_names ; then
CMD="rpm -q --provides"
else
docmd apm system info --full --format=json $pkg_names | get_json_values "data packageInfo provides"
return
fi
;;
urpm-rpm)
if is_installed $pkg_names ; then
CMD="rpm -q --provides"
......
......@@ -135,7 +135,7 @@ __epm_get_hilevel_nameform()
[ -n "$*" ] || return
case $PMTYPE in
apt-rpm)
apt-rpm|apm-rpm)
# use # as delimeter for apt
local pkg
pkg=$(a='' rpm -q --queryformat "%{NAME}=%{SERIAL}:%{VERSION}-%{RELEASE}\n" -- $1)
......
......@@ -45,7 +45,7 @@ epm_repodisable()
{
case $PMTYPE in
apt-rpm)
apt-rpm|apm-rpm)
assure_root
__epm_repodisable_alt "$@"
;;
......
......@@ -45,7 +45,7 @@ epm_repoenable()
{
case $PMTYPE in
apt-rpm)
apt-rpm|apm-rpm)
assure_root
__epm_repoenable_alt "$@"
;;
......
......@@ -134,7 +134,7 @@ epm_repoindex()
{
case $PMTYPE in
apt-rpm)
apt-rpm|apm-rpm)
__epm_repoindex_alt "$@"
;;
apt-dpkg|aptitude-dpkg)
......
......@@ -140,10 +140,10 @@ epm_repolist()
{
# TODO
[ -z "$*" ] || [ "$PMTYPE" = "apt-rpm" ] || [ "$PMTYPE" = "apt-dpkg" ] || fatal "No arguments are allowed here"
[ -z "$*" ] || [ "$PMTYPE" = "apt-rpm" ] || [ "$PMTYPE" = "apm-rpm" ] || [ "$PMTYPE" = "apt-dpkg" ] || fatal "No arguments are allowed here"
case $PMTYPE in
apt-rpm)
apt-rpm|apm-rpm)
if tasknumber "$1" >/dev/null ; then
# FIXME: unexpectedly, a list of packages instead of repositories.
get_task_packages "$@"
......
......@@ -101,7 +101,7 @@ epm_repo_pkgadd()
{
case $PMTYPE in
apt-rpm)
apt-rpm|apm-rpm)
__epm_repo_pkgadd_alt "$@"
;;
*)
......@@ -116,7 +116,7 @@ epm_repo_pkgupdate()
{
case $PMTYPE in
apt-rpm)
apt-rpm|apm-rpm)
__epm_repo_pkgupdate_alt "$@"
;;
*)
......@@ -131,7 +131,7 @@ epm_repo_pkgdel()
{
case $PMTYPE in
apt-rpm)
apt-rpm|apm-rpm)
__epm_repo_pkgdel_alt "$@"
;;
*)
......
......@@ -138,6 +138,22 @@ case $PMTYPE in
fi
fi
;;
apm-rpm)
# FIXME: need fix for a few names case
# FIXME: too low level of requires name (libSOME.so)
if is_installed $pkg_names ; then
assure_exists rpm >/dev/null
__epm_alt_rpm_requires $pkg_names
return
else
if [ -n "$short" ] ; then
docmd apm system info --full --format=json $pkg_names | get_json_values "data packageInfo depends" | __epm_filter_out_base_alt_reqs | sed -e "s| .*||"
else
docmd apm system info --full --format=json $pkg_names | get_json_values "data packageInfo depends" | __epm_filter_out_base_alt_reqs
fi
return
fi
;;
packagekit)
CMD="pkcon required-by"
;;
......
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