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
|