File: scratchbox2.postinst

package info (click to toggle)
scratchbox2 2.2.4-1debian1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 5,392 kB
  • ctags: 5,239
  • sloc: ansic: 21,734; sh: 4,360; perl: 2,170; cpp: 1,913; makefile: 610; python: 184
file content (36 lines) | stat: -rw-r--r-- 857 bytes parent folder | download
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/sh
#
#DEBHELPER#
#
# 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 [ -d $pathmaps/maemo ]; then
	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
fi