From 5ea6c1b890854d3ea678d0534451d0f31043a59a Mon Sep 17 00:00:00 2001 From: Xawotihs Date: Thu, 6 Jan 2011 20:17:34 +0000 Subject: [PATCH] [Maemo] Moved the copy of the ressources from the installation into a launcher script --- projects/mtg/debian/launcher | 24 ++++++++++++++++++++++++ projects/mtg/debian/postinst | 6 +----- projects/mtg/wagic.pro | 9 ++++++--- 3 files changed, 31 insertions(+), 8 deletions(-) create mode 100755 projects/mtg/debian/launcher diff --git a/projects/mtg/debian/launcher b/projects/mtg/debian/launcher new file mode 100755 index 000000000..3db681737 --- /dev/null +++ b/projects/mtg/debian/launcher @@ -0,0 +1,24 @@ +#!/bin/sh -e + +if grep -q /home/user/MyDocs /proc/mounts; then +# FAT partition mounted + mkdir -p /home/user/MyDocs/wagic + mkdir -p /home/user/MyDocs/wagic/Res +# Size used on the FAT partition + usedSize=`du -s /home/user/MyDocs/wagic/Res | awk '{print $1}'` +# Size needed on the FAT partition + dirSize=`du -s /home/user/wagic/Res | awk '{print $1}'` +# Size available on the FAT partition + avaSize=`df | grep /dev/mmcblk0p1 | awk '{print $4}'` + echo "$usedSize $dirSize $avaSize" + if [ $usedSize -lt 100 ] + then if [ $avaSize -gt $dirSize ] + then + echo "Copying resources on the FAT partition to ease customization" + cp -rf /home/user/wagic/Res/* /home/user/MyDocs/wagic/Res + fi + fi +fi + +./wagic +exit 0 diff --git a/projects/mtg/debian/postinst b/projects/mtg/debian/postinst index f56d064ba..897e7f9ba 100644 --- a/projects/mtg/debian/postinst +++ b/projects/mtg/debian/postinst @@ -1,12 +1,8 @@ #!/bin/sh -e chmod a+x /opt/wagic/wagic +chmod a+x /opt/wagic/launcher chmod -R a+rw /home/user/wagic -if grep -q /home/user/MyDocs /proc/mounts; then - mkdir -p /home/user/MyDocs/wagic - mkdir -p /home/user/MyDocs/wagic/Res - cp -rf /home/user/wagic/Res/* /home/user/MyDocs/wagic/Res -fi gtk-update-icon-cache -f /usr/share/icons/hicolor exit 0 diff --git a/projects/mtg/wagic.pro b/projects/mtg/wagic.pro index 54c617c00..96fd4ae0b 100644 --- a/projects/mtg/wagic.pro +++ b/projects/mtg/wagic.pro @@ -238,7 +238,6 @@ HEADERS += \ include/WResourceManager.h\ include/DuelLayers.h\ include/GuiStatic.h\ - include/ShopItem.h\ include/Effects.h\ include/StyleManager.h\ include/WFont.h\ @@ -319,8 +318,8 @@ HEADERS += \ ../../JGE/include/Vector2D.h\ ../../JGE/include/Vector3D.h\ ../../JGE/include/vram.h\ - ../../JGE/src/tinyxml\tinystr.h\ - ../../JGE/src/tinyxml\tinyxml.h\ + ../../JGE/src/tinyxml/tinystr.h\ + ../../JGE/src/tinyxml/tinyxml.h\ ../../JGE/include/vram.h maemo5: { @@ -335,6 +334,7 @@ maemo5: { icon \ res \ restxt \ + launcher \ target.path = $$BINDIR @@ -350,4 +350,7 @@ maemo5: { restxt.path = $$BINDIR restxt.files += debian/Res.txt + + launcher.path = $$BINDIR + launcher.files += debian/launcher }