scripts/create_addon: add support for $PKG_ADDON_REQUIRES

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2011-04-23 18:11:47 +02:00
parent 3034d01846
commit 7e0b03fe47
2 changed files with 14 additions and 2 deletions

View File

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="@PKG_ADDON_ID@"
name="@PKG_SHORTDESC@"
name="@PKG_NAME@"
version="@ADDON_VERSION@"
provider-name="openelec.tv">
<requires>
<import addon="os.openelec.tv" version="@OS_VERSION@"/>
<import addon="xbmc.python" version="1.0"/>
@REQUIRES@
</requires>
<extension point="@PKG_ADDON_TYPE@"
library="default.py">

View File

@ -22,6 +22,15 @@
. config/options $1
IFS=" "
for i in $PKG_ADDON_REQUIRES; do
REQUIRES_ADDONNAME=`echo $i | cut -f1 -d ":"`
REQUIRES_ADDONVERSION=`echo $i | cut -f2 -d ":"`
REQUIRES="$REQUIRES\n <import addon=\"$REQUIRES_ADDONNAME\" version=\"$REQUIRES_ADDONVERSION\" />"
done
unset IFS
if [ -z "$1" ]; then
echo "usage: $0 package_name"
exit 1
@ -46,8 +55,10 @@ if [ -f $PKG_DIR/addon ]; then
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID
cp config/addon/addon.xml $ADDON_BUILD/$PKG_ADDON_ID
$SED -e "s|@PKG_ADDON_ID@|$PKG_ADDON_ID|g" \
-e "s|@PKG_NAME@|$PKG_NAME|g" \
-e "s|@ADDON_VERSION@|$OS_VERSION.$PKG_REV|g" \
-e "s|@PKG_ADDON_TYPE@|$PKG_ADDON_TYPE|g" \
-e "s|@REQUIRES@|$REQUIRES|g" \
-e "s|@PKG_SHORTDESC@|$PKG_SHORTDESC|g" \
-e "s|@OS_VERSION@|$OS_VERSION|g" \
-e "s|@PKG_LONGDESC@|$PKG_LONGDESC|g" \