Commit caa2ed25 authored by Boris Yumankulov's avatar Boris Yumankulov Committed by Vitaly Lipatov

epm install: transform package_manager:package_name to EPM_BACKEND value (eterbug #17511)

parent 9a108809
......@@ -66,6 +66,35 @@ __separate_sudocmd()
return 0
}
process_package_arguments() {
local pmtype
local name
local arg
local package_groups
declare -A package_groups
VALID_BACKENDS="apt-rpm apt-dpkg aptitude-dpkg deepsolver-rpm urpm-rpm packagekit pkgsrc pkgng redox-pkg emerge pacman aura yum-rpm dnf-rpm snappy zypper-rpm mpkg eopkg conary npackd slackpkg homebrew opkg nix apk tce guix termux-pkg aptcyg xbps appget winget"
for arg in "$@"; do
case "$arg" in
*:*)
pmtype=$(echo "$arg" | cut -d: -f1)
name=$(echo "$arg" | cut -d: -f2)
if ! echo "$VALID_BACKENDS" | grep -qw "$pmtype"; then
pmtype=$PMTYPE
fi
;;
*)
pmtype=$PMTYPE
name="$arg"
;;
esac
package_groups["$pmtype"]+="$name "
done
for pmtype in "${!package_groups[@]}"; do
(PMTYPE="$pmtype" epm_install_names ${package_groups[$pmtype]})
done
}
# copied from etersoft-build-utils/share/eterbuild/functions/rpmpkg
epm_install_names()
{
......@@ -73,6 +102,11 @@ epm_install_names()
warmup_hibase
if echo "$@" | grep -q ':'; then
process_package_arguments "$@"
return
fi
if [ -n "$download_only" ] ; then
epm download "$@"
return
......
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