Commit 0391547b authored by Vitaly Lipatov's avatar Vitaly Lipatov

more clean and strict rules

parent 563f545d
......@@ -49,9 +49,8 @@ try_fix_apt_rpm_dupls()
epm_dedup()
{
case $PMTYPE in
apt-rpm)
# ALT Linux only
case "$DISTRNAME" in
"ALTLinux")
assure_exists /usr/share/apt/scripts apt-scripts
if [ -f /usr/share/apt/scripts/dedup.lua ] ; then
"Check for duplicates via apt-get dedup from apt-scripts"
......
......@@ -184,8 +184,8 @@ epm_download()
{
local CMD
case $DISTRNAME in
ALTLinux)
case $DISTRNAME-$PMTYPE in
ALTLinux-apt-rpm)
__epm_download_alt $pkg_filenames
return
;;
......
......@@ -442,10 +442,10 @@ epm_print_install_command()
#[ -z "$1" ] && return
[ -z "$1" ] && [ -n "$pkg_names" ] && return
case $PMTYPE in
apt-rpm|yum-rpm|urpm-rpm|zypper-rpm|dnf-rpm)
*-rpm)
echo "rpm -Uvh --force $nodeps $*"
;;
apt-dpkg|aptitude-dpkg)
*-dpkg)
echo "dpkg -i $*"
;;
pkgsrc)
......
......@@ -23,12 +23,12 @@ __epm_packages_sort()
{
# FIXME: sort depends on --sort value
case $PMTYPE in
apt-rpm|yum-rpm|urpm-rpm|zypper-rpm|dnf-rpm)
*-rpm)
# FIXME: space with quotes problems, use point instead
warmup_rpmbase
docmd rpm -qa --queryformat "%{size}@%{name}-%{version}-%{release}\n" $pkg_filenames | sed -e "s|@| |g" | sort -n -k1
;;
apt-dpkg)
*-dpkg)
warmup_dpkgbase
docmd dpkg-query -W --showformat="\${Installed-Size}@\${Package}-\${Version}:\${Architecture}\n" $pkg_filenames | sed -e "s|@| |g" | sort -n -k1
;;
......@@ -57,13 +57,6 @@ epm_packages()
[ -n "$sort" ] && __epm_packages_sort && return
case $PMTYPE in
apt-rpm)
warmup_rpmbase
# FIXME: strong equal
CMD="rpm -qa $pkg_filenames"
[ -n "$short" ] && CMD="rpm -qa --queryformat %{name}\n $pkg_filenames"
docmd $CMD
return ;;
*-dpkg)
warmup_dpkgbase
# FIXME: strong equal
......@@ -74,10 +67,7 @@ case $PMTYPE in
showcmd $CMD
$CMD | grep "^i" | sed -e "s|.* ||g" | __fo_pfn
return ;;
snappy)
CMD="snappy info"
;;
yum-rpm|urpm-rpm|zypper-rpm|dnf-rpm)
*-rpm)
warmup_rpmbase
# FIXME: strong equal
CMD="rpm -qa $pkg_filenames"
......@@ -87,6 +77,9 @@ case $PMTYPE in
packagekit-*)
docmd pkcon get-packages --filter installed
;;
snappy)
CMD="snappy info"
;;
emerge)
CMD="qlist -I -C"
# print with colors for console output
......
#!/bin/sh
#
# Copyright (C) 2015, 2017 Etersoft
# Copyright (C) 2015, 2017 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2015, 2017, 2019 Etersoft
# Copyright (C) 2015, 2017, 2019 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
......@@ -31,7 +31,7 @@ warmup_bases
pkg_names=$(__epm_get_hilevel_name $pkg_names)
case $PMTYPE in
apt-rpm)
apt-*)
docmd apt-cache policy $pkg_names
;;
packagekit-*)
......
......@@ -78,17 +78,11 @@ __do_query()
{
local CMD
case $PMTYPE in
apt-rpm)
CMD="rpm -qf"
;;
*-dpkg)
showcmd dpkg -S "$1"
dpkg_print_name_version "$(dpkg -S $1 | grep -v "^diversion by" | sed -e "s|:.*||")"
return ;;
yum-rpm|dnf-rpm|urpm-rpm)
CMD="rpm -qf"
;;
zypper-rpm)
*-rpm)
CMD="rpm -qf"
;;
emerge)
......
#!/bin/sh
#
# Copyright (C) 2012-2014, 2016, 2017 Etersoft
# Copyright (C) 2012-2014, 2016, 2017 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012-2014, 2016, 2017, 2019 Etersoft
# Copyright (C) 2012-2014, 2016, 2017, 2019 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
......@@ -30,10 +30,10 @@ epm_remove_low()
warmup_lowbase
case $PMTYPE in
apt-rpm|yum-rpm|zypper-rpm|urpm-rpm|dnf-rpm)
*-rpm)
sudocmd rpm -ev $nodeps $@
return ;;
apt-dpkg|aptitude-dpkg)
*-dpkg|-dpkg)
# shellcheck disable=SC2046
sudocmd dpkg -P $(subst_option nodeps --force-all) $(print_name "$@")
return ;;
......@@ -204,10 +204,10 @@ epm_remove_nonint()
epm_print_remove_command()
{
case $PMTYPE in
apt-rpm|yum-rpm|zypper-rpm|urpm-rpm|dnf-rpm)
*-rpm)
echo "rpm -ev $nodeps $*"
;;
apt-dpkg|aptitude-dpkg)
*-dpkg)
echo "dpkg -P $*"
;;
packagekit-*)
......
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