Commit 2f0cf575 authored by Anton Midyukov's avatar Anton Midyukov

alternatives: initial feature

This feature allows you to set alternatives [1]. For example, like this: @$(call add,ALTERNATIVES,/usr/bin/xvt:/usr/bin/xterm) Also, in the config itself, targets for setting alternatives may already be predefined. For example, use/alternatives/xvt/% allows you to specify arbitrary alternatives for xvt: use/alternatives/xvt/xterm, use/alternatives/xvt/mate-terminal, etc. However, an alternative must be available. 1. https://www.altlinux.org/Alternatives
parent 388c0fbb
......@@ -54,6 +54,8 @@ include::../features.in/README[]
include::../features.in/00example/README[]
include::../features.in/alternatives/README[]
include::../features.in/apt-conf/README[]
include::../features.in/armh-mcom02/README[]
......
=== features.in/alternatives ===
Данная фича позволяет задавать альтернативы [1].
Например, так:
@$(call add,ALTERNATIVES,/usr/bin/xvt:/usr/bin/xterm)
Также в самом конфиге могут быть уже преопределены цели для установки альтернатив.
Например, use/alternatives/xvt/% позволяет задавать произвольные альтернативы для xvt:
use/alternatives/xvt/xterm, use/alternatives/xvt/mate-terminal и т.д.
При этом альтернатива должна быть доступна.
1. https://www.altlinux.org/Alternatives
use/alternatives:
@$(call add_feature)
@$(call xport,ALTERNATIVES)
use/alternatives/xvt/%: use/alternatives
@$(call add,ALTERNATIVES,/usr/bin/xvt:/usr/bin/$*)
#!/bin/sh -efu
[ -n "$GLOBAL_ALTERNATIVES" ] || exit 0
for alternative in $GLOBAL_ALTERNATIVES; do
candidate="${alternative#*:}"
alternative="${alternative%:*}"
alternatives-manual "$alternative" "$candidate"
done
alternatives-update
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