Commit f0a3c7f9 authored by Vitaly Lipatov's avatar Vitaly Lipatov

use $@ instead of pkg_filenames where possible

parent 1ad3e100
......@@ -25,7 +25,7 @@ __epm_orphan_altrpm()
epm_autoorphans()
{
[ -z "$pkg_filenames" ] || fatal "No arguments are allowed here"
[ -z "$*" ] || fatal "No arguments are allowed here"
case $PMTYPE in
......
......@@ -37,7 +37,7 @@ __remove_deb_apt_cache_file()
epm_clean()
{
[ -z "$pkg_filenames" ] || fatal "No arguments are allowed here"
[ -z "$*" ] || fatal "No arguments are allowed here"
case $PMTYPE in
......
......@@ -79,6 +79,7 @@ epm_downgrade()
local APTOPTIONS="$(subst_option non_interactive -y)"
__epm_add_alt_apt_downgrade_preferences || return
load_helper epm-upgrade
# pass pkg_filenames too
epm_upgrade "$@"
__epm_remove_apt_downgrade_preferences
;;
......
......@@ -190,40 +190,40 @@ epm_download()
case $DISTRNAME-$PMTYPE in
ALTLinux-apt-rpm)
__epm_download_alt $pkg_filenames
__epm_download_alt $*
return
;;
esac
case $PMTYPE in
dnf-rpm)
sudocmd dnf download $pkg_filenames
sudocmd dnf download $*
;;
aptcyg)
sudocmd apt-cyg download $pkg_filenames
sudocmd apt-cyg download $*
;;
packagekit)
docmd pkcon download $pkg_filenames
docmd pkcon download $*
;;
yum-rpm)
# TODO: check yum install --downloadonly --downloaddir=/tmp <package-name>
assure_exists yumdownloader yum-utils
sudocmd yumdownloader $pkg_filenames
sudocmd yumdownloader $*
;;
dnf-rpm)
sudocmd dnf download $pkg_filenames
sudocmd dnf download $*
;;
urpm-rpm)
sudocmd urpmi --no-install $URPMOPTIONS $@
;;
tce)
sudocmd tce-load -w $pkg_filenames
sudocmd tce-load -w $*
;;
opkg)
docmd opkg $pkg_filenames
docmd opkg $*
;;
homebrew)
docmd brew fetch $pkg_filenames
docmd brew fetch $*
;;
*)
fatal "Have no suitable command for $PMTYPE"
......
......@@ -35,8 +35,8 @@ epm_kernel_update()
fi
assure_exists update-kernel update-kernel 0.9.9
update_repo_if_needed
sudocmd update-kernel $(subst_option non_interactive -y) $pkg_filenames || return
docmd epm remove-old-kernels $(subst_option non_interactive -y) $pkg_filenames || fatal
sudocmd update-kernel $(subst_option non_interactive -y) "$@" || return
docmd epm remove-old-kernels $(subst_option non_interactive -y) "$@" || fatal
return ;;
esac
......
......@@ -32,7 +32,7 @@ __repack_rpm_base()
epm_optimize()
{
[ -z "$pkg_filenames" ] || fatal "No arguments are allowed here"
[ -z "$*" ] || fatal "No arguments are allowed here"
case $PMTYPE in
*-rpm)
......
......@@ -32,7 +32,7 @@ epm_remove_old_kernels()
return
fi
assure_exists update-kernel update-kernel 0.9.9
sudocmd remove-old-kernels $(subst_option non_interactive -y) $pkg_filenames
sudocmd remove-old-kernels $(subst_option non_interactive -y) "$@"
return ;;
Ubuntu)
load_helper epm-query_package
......@@ -52,7 +52,7 @@ epm_remove_old_kernels()
assure_exists purge-old-kernels byobu
;;
esac
sudocmd purge-old-kernels $pkg_filenames
sudocmd purge-old-kernels "$@"
return ;;
Gentoo)
sudocmd emerge -P gentoo-sources
......
......@@ -180,8 +180,6 @@ case $DISTRNAME in
;;
esac
[ -z "$1" ] || fatal "No arguments are allowed here"
case $PMTYPE in
# apt-rpm)
# ;;
......
......@@ -70,8 +70,8 @@ epm_repolist()
case $PMTYPE in
apt-rpm)
#assure_exists apt-repo
if tasknumber "$pkg_names" >/dev/null ; then
get_task_packages $pkg_names
if tasknumber "$1" >/dev/null ; then
get_task_packages "$@"
else
print_apt_sources_list
#docmd apt-repo list
......
#!/bin/sh
#
# Copyright (C) 2012, 2014, 2016, 2019 Etersoft
# Copyright (C) 2012, 2014, 2016, 2019 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012, 2014, 2016, 2019, 2021 Etersoft
# Copyright (C) 2012, 2014, 2016, 2019, 2021 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
......@@ -24,8 +24,6 @@ epm_upgrade()
{
local CMD
#[ -z "$pkg_filenames" ] || fatal "No arguments are allowed here"
# it is useful for first time running
update_repo_if_needed
......@@ -33,12 +31,12 @@ epm_upgrade()
if [ "$DISTRNAME" = "ALTLinux" ] ; then
load_helper epm-sh-altlinux
if tasknumber "$pkg_names" >/dev/null ; then
if tasknumber "$*" >/dev/null ; then
load_helper epm-addrepo
load_helper epm-removerepo
load_helper epm-Install
epm_addrepo "$pkg_names"
local installlist="$(get_task_packages $pkg_names)"
epm_addrepo "$*"
local installlist="$(get_task_packages $*)"
# hack: drop -devel packages to avoid package provided by multiple packages
installlist="$(estrlist reg_exclude ".*-devel .*-devel-static" "$installlist")"
[ -n "$verbose" ] && info "Packages from task(s): $installlist"
......@@ -69,18 +67,18 @@ epm_upgrade()
yum-rpm)
local OPTIONS="$(subst_option non_interactive -y)"
# can do update repobase automagically
CMD="yum $OPTIONS update $pkg_filenames"
CMD="yum $OPTIONS update $*"
;;
dnf-rpm)
local OPTIONS="$(subst_option non_interactive -y)"
CMD="dnf $OPTIONS distro-sync $pkg_filenames"
CMD="dnf $OPTIONS distro-sync $*"
;;
snappy)
CMD="snappy update"
;;
urpm-rpm)
# or --auto-select --replace-files
CMD="urpmi --update --auto-select $pkg_filenames"
CMD="urpmi --update --auto-select $*"
;;
zypper-rpm)
CMD="zypper dist-upgrade"
......@@ -136,6 +134,6 @@ epm_upgrade()
;;
esac
sudocmd $CMD $pkg_filenames
sudocmd $CMD "$@"
}
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