summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Dewender2012-07-25 00:26:03 +0000
committerJohannes Dewender2012-07-25 00:26:03 +0000
commitac6da462055985722203e82d53aed327a2e25ced (patch)
tree42d796b9337d9fd53cd467d524c4aaca11f7db38
parent31eb4e9b5913ba9f27131908708e89e7158ebc5c (diff)
downloadaur-ac6da462055985722203e82d53aed327a2e25ced.tar.gz
holyspirit-svn: remove pkgdir traces; + config_crash.patch
git-svn-id: http://svn.kraehen.org/aur@147 04e22907-73ef-438a-a52f-a971dc6d3b47
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD11
-rw-r--r--config_crash.patch51
-rw-r--r--holyspirit.install11
4 files changed, 72 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index fc26ebf26978..58c4324b03ac 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -17,7 +17,9 @@ pkgbase = holyspirit-svn
backup = opt/share/games/holyspirit/configuration.conf
backup = opt/share/games/holyspirit/key_mapping.conf
source = holyspirit.sh
+ source = config_crash.patch
md5sums = c2fa4f8768d35c54a95dec924e50c75f
+ md5sums = b997e0c5d714c615509db7850d0290e3
pkgname = holyspirit-svn
diff --git a/PKGBUILD b/PKGBUILD
index 28c7fee853d5..9ad7403f6834 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,9 +13,10 @@ optdepends=('qtwebkit: for the launcher')
provides=('holyspirit')
conflicts=('holyspirit')
install=holyspirit.install
-source=(holyspirit.sh)
+source=(holyspirit.sh config_crash.patch)
backup=('opt/share/games/holyspirit/configuration.conf' 'opt/share/games/holyspirit/key_mapping.conf')
-md5sums=('c2fa4f8768d35c54a95dec924e50c75f')
+md5sums=('c2fa4f8768d35c54a95dec924e50c75f'
+ 'b997e0c5d714c615509db7850d0290e3')
_svntrunk=https://lechemindeladam.svn.sourceforge.net/svnroot/lechemindeladam/trunk
_svnmod=holyspirit
@@ -37,6 +38,8 @@ build() {
cp -r "$srcdir/$_svnmod" "$srcdir/$_svnmod-build"
cd "$srcdir/$_svnmod-build"
+ patch -p1 < ../config_crash.patch
+
cmake -DSFML_STATIC_LIBRARIES=FALSE \
-DCMAKE_INSTALL_PREFIX:STRING="$pkgdir/opt"
@@ -65,9 +68,11 @@ package() {
mkdir -p "$pkgdir/usr/share"
mv "$pkgdir/opt/share/applications" "$pkgdir/usr/share/applications"
mv "$pkgdir/opt/share/icons" "$pkgdir/usr/share/icons"
+ sed -i -e "s|$pkgdir/opt|/opt/share|g" \
+ "$pkgdir/usr/share/applications/Holyspirit.desktop"
# make savegames, config and temp dirs writable
- chown -R root:games "$pkgdir/opt/share/games/holyspirit/"{Data/User,{configuration,key_mapping}.conf}
+ chgrp -R games "$pkgdir/opt/share/games/holyspirit/"{Data/User,{configuration,key_mapping}.conf}
chmod -R g+w "$pkgdir/opt/share/games/holyspirit/"{Data/User,{configuration,key_mapping}.conf}
install -D "$srcdir/holyspirit.sh" "$pkgdir/usr/bin/holyspirit"
diff --git a/config_crash.patch b/config_crash.patch
new file mode 100644
index 000000000000..744a21703238
--- /dev/null
+++ b/config_crash.patch
@@ -0,0 +1,51 @@
+From: Johannes Dewender <jonnyjd@users.sf.net>
+Date: Wed, 25 Jul 2012 01:22:42.463515335 +0200
+Subject: [PATCH] fix crash on saving configuration
+
+Holyspirit crashed on exit when the configuration files were not writable.
+
+Signed-off-by: Johannes Dewender <jonnyjd@users.sf.net>
+
+Index: trunk/Source/main.cpp
+===================================================================
+--- trunk/Source/main.cpp (revision 2381)
++++ trunk/Source/main.cpp (working copy)
+@@ -88,7 +88,15 @@
+ console->Ajouter("");
+ console->Ajouter("Saving configuration");
+
+- configuration->Sauvegarder();
++ try
++ {
++ configuration->Sauvegarder();
++ }
++ catch (const std::string& str)
++ {
++ console->Ajouter("WARNING : ",1);
++ console->Ajouter(str,1);
++ }
+
+ console->Ajouter("");
+ console->Ajouter("Destruction of engines");
+Index: trunk/Source/configuration.cpp
+===================================================================
+--- trunk/Source/configuration.cpp (revision 2381)
++++ trunk/Source/configuration.cpp (working copy)
+@@ -608,7 +608,7 @@
+ fichier.close();
+ }
+ else
+- throw "Unable to save configuration";
++ throw std::string("Unable to save configuration : configuration.conf");
+ }
+
+ void Configuration::SauvegarderKeyMapping()
+@@ -639,7 +639,7 @@
+ fichier.close();
+ }
+ else
+- throw "Unable to save configuration";
++ throw std::string("Unable to save configuration : key_mapping.conf");
+ }
+
+
diff --git a/holyspirit.install b/holyspirit.install
index 1eb07338ec80..948d2fe9a31f 100644
--- a/holyspirit.install
+++ b/holyspirit.install
@@ -1,3 +1,14 @@
+logfile="/opt/share/games/holyspirit/Log.txt"
+
post_install() {
echo "Add yourself to the games group and relog to play holyspirit"
+ if [ ! -e "$logfile" ]; then
+ touch "$logfile"
+ chgrp games "$logfile"
+ chmod g+w "$logfile"
+ fi
+}
+
+pre_remove() {
+ rm -f "$logfile"
}