Commit 1905b30f authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play.d/common.sh: fix PKGNAME detection

parent 43fbb68b
...@@ -66,10 +66,19 @@ get_pkgvendor() ...@@ -66,10 +66,19 @@ get_pkgvendor()
epm print field Vendor for package $1 epm print field Vendor for package $1
} }
get_first()
{
echo "$1"
}
check_alternative_pkgname() check_alternative_pkgname()
{ {
[ -n "$BASEPKGNAME" ] || BASEPKGNAME="$PKGNAME" [ -n "$BASEPKGNAME" ] || BASEPKGNAME="$PKGNAME"
# default: with first entry in $PEODUCTALT
PKGNAME="$BASEPKGNAME-$(get_first $PRODUCTALT)"
# override with VERSION
local i local i
for i in $PRODUCTALT ; do for i in $PRODUCTALT ; do
if [ "$i" = "''" ] ; then if [ "$i" = "''" ] ; then
...@@ -82,9 +91,12 @@ check_alternative_pkgname() ...@@ -82,9 +91,12 @@ check_alternative_pkgname()
return return
fi fi
done done
# when VERSION is not in PRODUCTALT
# when VERSION is not in PRODUCTALT, check installed package
for i in $PRODUCTALT ; do for i in $PRODUCTALT ; do
[ "$i" = "''" ] && continue if [ "$i" = "''" ] ; then
continue
fi
if epm installed $BASEPKGNAME-$i ; then if epm installed $BASEPKGNAME-$i ; then
PKGNAME=$BASEPKGNAME-$i PKGNAME=$BASEPKGNAME-$i
break break
......
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