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