mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
Merge pull request #2465 from stefansaraev/multiple-pkg-dirs
config/path: handle multiple package dirs
This commit is contained in:
commit
8d0a3f6303
20
config/path
20
config/path
@ -55,13 +55,27 @@ SED="sed -i"
|
|||||||
PKG_IS_ADDON="no"
|
PKG_IS_ADDON="no"
|
||||||
|
|
||||||
if [ -n "$1" ]; then
|
if [ -n "$1" ]; then
|
||||||
PKG_DIR=`find $PACKAGES -type d -name $1 ! -wholename \*\/source\/\* 2>/dev/null`
|
FOUND=0
|
||||||
if [ "${PKG_DIR}" != "$(echo $PKG_DIR | tr -d '\n')" ]; then
|
for DIR in `find $PACKAGES -type d -name $1 ! -wholename \*\/source\/\* 2>/dev/null` ; do
|
||||||
|
# keep track of dirs with meta for debugging
|
||||||
|
if [ -z "$ALL_DIRS" ] ; then
|
||||||
|
ALL_DIRS="$DIR"
|
||||||
|
else
|
||||||
|
ALL_DIRS="$ALL_DIRS\\n$DIR"
|
||||||
|
fi
|
||||||
|
if [ -f "$DIR/meta" -o -f "$DIR/install" ] ; then
|
||||||
|
FOUND=$((FOUND+1))
|
||||||
|
# found first. set $PKG_DIR
|
||||||
|
PKG_DIR="$DIR"
|
||||||
|
if [ $FOUND -gt 1 ] ; then
|
||||||
|
# found more ? fail
|
||||||
echo "Error - multiple package folders:"
|
echo "Error - multiple package folders:"
|
||||||
echo "$PKG_DIR"
|
echo -e "$ALL_DIRS"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
[ -r $PKG_DIR/meta ] && . $PKG_DIR/meta
|
[ -r $PKG_DIR/meta ] && . $PKG_DIR/meta
|
||||||
if [ "$PKG_IS_ADDON" = "yes" ] ; then
|
if [ "$PKG_IS_ADDON" = "yes" ] ; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user