Commit 57abc0aa authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-install: fix prefix parsing

parent daca23b0
...@@ -72,26 +72,26 @@ process_package_arguments() { ...@@ -72,26 +72,26 @@ process_package_arguments() {
local arg local arg
local package_groups local package_groups
declare -A package_groups declare -A package_groups
# ONLY supported backend in short form?
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" 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 for arg in "$@"; do
pmtype=$PMTYPE
name="$arg"
tpmtype=$(echo "$arg" | cut -d: -f1)
case "$arg" in case "$arg" in
*:*) *:*)
pmtype=$(echo "$arg" | cut -d: -f1) # FIXME
name=$(echo "$arg" | cut -d: -f2) if echo "$arg" | grep -q "^[a-z][a-z][a-z]*:" && echo "$VALID_BACKENDS" | grep -qw "$tpmtype"; then
if ! echo "$VALID_BACKENDS" | grep -qw "$pmtype"; then pmtype=$tpmtype
pmtype=$PMTYPE name=$(echo "$arg" | cut -d: -f2)
fi fi
;; ;;
*)
pmtype=$PMTYPE
name="$arg"
;;
esac esac
package_groups["$pmtype"]+="$name " package_groups["$pmtype"]+="$name "
done done
for pmtype in "${!package_groups[@]}"; do for pmtype in "${!package_groups[@]}"; do
(PMTYPE="$pmtype" epm_install_names ${package_groups[$pmtype]}) (PMTYPE="$pmtype" PPARGS=1 epm_install_names ${package_groups[$pmtype]})
done done
} }
...@@ -100,9 +100,8 @@ epm_install_names() ...@@ -100,9 +100,8 @@ epm_install_names()
{ {
[ -z "$1" ] && return [ -z "$1" ] && return
warmup_hibase # check some like nix: prefix, PPARGS for stop possible recursion. TODO
if echo "$*" | grep -q '[a-z][a-z][a-z]*:' && [ -z "$PPARGS" ] ; then
if echo "$@" | grep -q ':'; then
process_package_arguments "$@" process_package_arguments "$@"
return return
fi fi
...@@ -112,6 +111,8 @@ epm_install_names() ...@@ -112,6 +111,8 @@ epm_install_names()
return return
fi fi
warmup_hibase
if [ -n "$dryrun" ] ; then if [ -n "$dryrun" ] ; then
load_helper epm-simulate load_helper epm-simulate
epm simulate "$@" epm simulate "$@"
......
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