summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2016-12-28 11:22:30 +0800
committerAlejandro del Castillo <alejandro.delcastillo@ni.com>2016-12-30 11:02:55 -0600
commitc852b46bd6ba63fe4c37e023cfcb743c82312a13 (patch)
treea38fbe39b788e075bdf3a515886f09a720095483
parent9228b38a81c94bd95ada3a6334404923d67bea66 (diff)
downloadopkg-utils-c852b46bd6ba63fe4c37e023cfcb743c82312a13.tar.gz
opkg-utils-c852b46bd6ba63fe4c37e023cfcb743c82312a13.tar.bz2
opkg-utils-c852b46bd6ba63fe4c37e023cfcb743c82312a13.zip
update-alternatives: warn when multiple providers have the same priority
Warn users when multiple providers of a utility have the same priority. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
-rw-r--r--update-alternatives3
1 files changed, 3 insertions, 0 deletions
diff --git a/update-alternatives b/update-alternatives
index ca01d5d..ffad853 100644
--- a/update-alternatives
+++ b/update-alternatives
@@ -90,6 +90,9 @@ add_alt() {
local path="$2"
local priority="$3"
remove_alt $name $path
+ if grep -qw "$priority" $ad/$name; then
+ echo "Warn: update-alternatives: $name has multiple providers with the same priority, please check $ad/$name for details"
+ fi
echo "$path $priority" >> $ad/$name
}