Commit 18dace21 authored by Vitaly Lipatov's avatar Vitaly Lipatov

fix filling of qouted_args, run helpers with full args, drop obsoleted related code

parent cebcff95
......@@ -410,11 +410,11 @@ FLAGENDOPTS=
for opt in "$@" ; do
[ "$opt" = "--" ] && FLAGENDOPTS=1 && continue
if [ -z "$FLAGENDOPTS" ] ; then
check_command $opt && continue
check_option $opt && continue
check_command "$opt" && continue
check_option "$opt" && continue
fi
# Note: will parse all params separately (no package names with spaces!)
check_filenames $opt
check_filenames "$opt"
done
# if input is not console and run script from file, get pkgs from stdin too
......@@ -457,7 +457,7 @@ case $epm_cmd in
;;
esac
# Run helper for command
# Run helper for command with natural args
load_helper epm-$epm_cmd
epm_$epm_cmd
eval epm_$epm_cmd $quoted_args
# return last error code (from subroutine)
......@@ -114,7 +114,7 @@ __epm_addrepo_altlinux()
epm_addrepo()
{
local repo="$(eval echo "$quoted_args")"
local repo="$*"
case $DISTRNAME in
ALTLinux)
......
......@@ -96,7 +96,7 @@ __epm_assure_checking()
# $2 - [package name]
# $3 - [needed package version]
__epm_assure()
epm_assure()
{
local CMD="$1"
local PACKAGE="$2"
......@@ -115,13 +115,3 @@ __epm_assure()
__epm_need_update $PACKAGE $PACKAGEVERSION && return 1
return 0
}
epm_assure()
{
[ -n "$pkg_filenames" ] || fatal "Assure: Missing params. Check $0 --help for info."
# use helper func for extract separate params
# shellcheck disable=SC2046
__epm_assure $(eval echo $quoted_args)
}
......@@ -124,7 +124,7 @@ compare_version()
rpmevrcmp "$@"
}
__epm_print()
epm_print()
{
local WHAT="$1"
shift
......@@ -255,14 +255,3 @@ EOF
;;
esac
}
epm_print()
{
[ -n "$pkg_filenames" ] || fatal "Missed args. Use epm print help for get help."
# Note! do not quote args below (see eterbug #11863)
# shellcheck disable=SC2046
__epm_print $(eval echo $quoted_args)
}
......@@ -71,11 +71,10 @@ __epm_removerepo_alt()
epm_removerepo()
{
local repo="$(eval echo $quoted_args)"
case $DISTRNAME in
ALTLinux)
__epm_removerepo_alt $repo
__epm_removerepo_alt "$@"
return
;;
esac;
......@@ -83,7 +82,7 @@ esac;
case $PMTYPE in
apt-dpkg)
assure_exists apt-add-repository software-properties-common
sudocmd apt-add-repository --remove "$repo"
sudocmd apt-add-repository --remove "$@"
info "Check file /etc/apt/sources.list if needed"
;;
aptitude-dpkg)
......@@ -91,22 +90,22 @@ case $PMTYPE in
;;
yum-rpm)
assure_exists yum-utils
sudocmd yum-config-manager --disable "$repo"
sudocmd yum-config-manager --disable "$@"
;;
urpm-rpm)
sudocmd urpmi.removemedia "$repo"
sudocmd urpmi.removemedia "$@"
;;
zypper-rpm)
sudocmd zypper removerepo "$repo"
sudocmd zypper removerepo "$@"
;;
emerge)
sudocmd layman "-d$repo"
sudocmd layman "-d$@"
;;
pacman)
info "You need remove repo from /etc/pacman.conf"
;;
npackd)
sudocmd npackdcl remove-repo --url="$repo"
sudocmd npackdcl remove-repo --url="$@"
;;
slackpkg)
info "You need remove repo from /etc/slackpkg/mirrors"
......
......@@ -365,7 +365,7 @@ assure_exists()
local textpackage=
[ -n "$package" ] || package="$(__get_package_for_command "$1")"
[ -n "$3" ] && textpackage=" >= $3"
__epm_assure "$1" $package $3 || fatal "Can't assure in '$1' command from $package$textpackage package"
epm_assure "$1" $package $3 || fatal "Can't assure in '$1' command from $package$textpackage package"
}
# will replaced within disabled_eget in packaged version
......
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