forked from szymex/xbmc-finnish-tv
-
Notifications
You must be signed in to change notification settings - Fork 2
/
make-release.sh
executable file
·37 lines (32 loc) · 1001 Bytes
/
make-release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
REPOSITORY=./repo
PLUGINS=$(find . -maxdepth 1 -type d -name 'plugin.video.*')
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' > ./addons.xml
echo "<addons>" >> ./addons.xml
cat ./repository.finnish-tv/addon.xml | grep -v "<?xml" >> ./addons.xml
echo "Release generator.."
USE_THE_FORCE=0
for var in $@;do
case $var in
--force|-f)
USE_THE_FORCE=1
;;
esac
done
for i in $PLUGINS
do
#echo "check if version of plugin $i exists on repo"
#VERSION=$(xpath -q -e "/addon/attribute::version" $i/addon.xml | awk -F\" '{ print $2 }')
VERSION=$(perl -n -e'/^[ ]+version="(.*?)"/ && print $1' $i/addon.xml)
REPOFILE=$REPOSITORY/$i/$i-$VERSION.zip
if [ -f $REPOFILE -a $USE_THE_FORCE -eq 0 ]
then
echo " skip: $i-$VERSION"
else
echo " new release: $i-$VERSION"
zip -r $REPOFILE $i [email protected] > /dev/null
fi
cat $i/addon.xml | grep -v "<?xml" >> ./addons.xml
done
echo "</addons>" >> ./addons.xml
md5sum addons.xml > addons.xml.md5