summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorMika Westerberg <ext-mika.1.westerberg@nokia.com>2008-10-28 08:37:06 +0200
committerLauri Leukkunen <lle@rahina.org>2008-11-02 18:59:55 +0200
commit715902327fb4193b1778a614c0eb68c59e344314 (patch)
tree93ff746eb0efcc9b9d55bec69b3db0f50a3820f6 /debian
parent4f63db5d92577d13692c9e2d76ca6e530f191b6a (diff)
Added postinst script that handles maemo -> devel symlinking correctly.
Signed-off-by: Lauri Aarnio <Lauri.Aarnio@iki.fi>
Diffstat (limited to 'debian')
-rw-r--r--debian/scratchbox2.postinst32
1 files changed, 32 insertions, 0 deletions
diff --git a/debian/scratchbox2.postinst b/debian/scratchbox2.postinst
new file mode 100644
index 0000000..a40977c
--- /dev/null
+++ b/debian/scratchbox2.postinst
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# This scripts checks whether
+# /usr/share/scratchbox2/lua_scripts/pathmaps/maemo is
+# empty directory and if it is, it replaces it with
+# symlink pointing to 'devel'. This is done because
+# during upgrade, dpkg doesn't handle changing directory
+# to symlink correctly.
+#
+
+pathmaps=/usr/share/scratchbox2/lua_scripts/pathmaps
+
+if [ -L $pathmaps/maemo ]; then
+ #
+ # If symlink is already in place we don't
+ # do anything.
+ #
+ exit 0
+fi
+
+#
+# If rmdir succeeds we know that the directory was empty
+# and we can put our symlink in place. Otherwise user has
+# probably done some changes into mappings so we just issue
+# a warning.
+#
+if /bin/rmdir $pathmaps/maemo > /dev/null 2>&1; then
+ ln -ns devel $pathmaps/maemo
+else
+ echo "Can't symlink maemo -> devel, directory is not empty"
+ exit 0
+fi