homebrewfilter/distribute

87 lines
1.7 KiB
Plaintext
Raw Normal View History

2012-03-12 13:00:33 +01:00
#!/bin/bash
2012-03-18 23:16:30 +01:00
compile_hbf ()
{
make || exit 1
}
compile_boot ()
{
2012-03-19 10:40:22 +01:00
if [[ -e $PWD/boot.dol && ! $FORCE ]]; then
2012-03-18 23:16:30 +01:00
cp boot.dol boot/source/hbf.dol
make -C boot/ || exit 1
else compile_hbf
cp boot.dol boot/source/hbf.dol
make -C boot/ || exit 1
fi
}
compile_installer ()
{
2012-03-19 10:40:22 +01:00
if [[ -e boot/boot.dol && ! $FORCE ]]; then
2012-03-18 23:16:30 +01:00
cp boot/boot.dol installer/wad/00000002.app
else compile_boot
2012-03-19 10:40:22 +01:00
cp boot/boot.dol installer/wad/00000002.app
2012-03-18 23:16:30 +01:00
fi
wine installer/WadMii.exe -input "Z:\home\chris\Projekte\homebrewfilter\installer\wad" -output "Z:\home\chris\Projekte\homebrewfilter\installer\data\install.wad"
sleep 5
if [[ -e installer/data/install.wad ]]; then
2012-03-18 23:17:09 +01:00
make -C installer || exit 1
2012-03-18 23:16:30 +01:00
else echo -e "--Error installer/data/install.wad not found--"
exit 1
fi
}
make_distribution ()
{
2012-03-19 10:40:22 +01:00
if [[ -e installer/boot.dol && ! $FORCE ]]; then
2012-03-18 23:16:30 +01:00
cp installer/boot.dol HomebrewFilter/
else compile_installer
cp installer/boot.dol HomebrewFilter/
fi
XREV=$(grep "define SVN_REV" svnrev/svnrev.c | gawk '{print $3}')
cp data/meta.xml.in HomebrewFilter/meta.xml
sed -e "s/@REV@/$XREV/g" -i HomebrewFilter/meta.xml
2012-03-20 20:19:34 +01:00
sed -e '/./{H;$!d;}' -e "x;/rev$XREV/!d;" updates >> HomebrewFilter/meta.xml
2012-03-18 23:16:30 +01:00
echo -e "\n </long_description>\n</app>" >> HomebrewFilter/meta.xml
}
make_filelist()
{
ARC=$1
THM=$(basename $1 .zip)
unp -U $1
cd $THM/
for i in $(ls -1 *.png *.xml); do \
echo "$THM/file:$i" >> temp ; \
cat temp | tr "\n" "+" > filelist ; \
done
}
2012-03-18 23:18:05 +01:00
if [[ $1 == "-c" ]]; then
make clean
make -C boot clean
2012-03-19 08:04:03 +01:00
make -C installer clean
rm HomebrewFilter/meta.xml
elif [[ $1 == "-l" ]]; then
make_filelist $2
2012-03-19 10:40:22 +01:00
elif [[ $1 == "-f" ]]; then
FORCE=YES
make_distribution
2012-03-19 08:04:03 +01:00
else make_distribution
2012-03-18 23:18:05 +01:00
fi