base-directories: remove symlinks for /tmp, /var/tmp, /var/lock and /dev/shm.

This commit is contained in:
Juan RP 2011-10-11 06:01:11 +02:00
parent 89b5ac2650
commit 121ab5cdde
2 changed files with 3 additions and 39 deletions

View File

@ -40,48 +40,12 @@ make_system_dirs()
[ ! -h usr/lib64 ] && ln -sf /usr/lib usr/lib64
fi
[ ! -d lib/rc ] && install -d lib/rc
for d in init.d udev; do
if [ ! -d run/${d} -a ! -h run/${d} ]; then
install -dm0755 run/${d}
fi
done
for d in lock tmp shm; do
if [ ! -d run/${d} -a ! -h run/${d} ]; then
install -dm1777 run/${d}
fi
done
install -dm1777 tmp
install -dm1777 var/tmp
}
case "${ACTION}" in
post)
make_system_dirs
# Create compat symlinks for /run.
mntpnts="tmp /run/tmp"
mntpnts="$mntpnts var/tmp /run/tmp"
mntpnts="$mntpnts var/run /run"
mntpnts="$mntpnts var/lock /run/lock"
mntpnts="$mntpnts lib/rc/init.d /run/init.d"
set -- ${mntpnts}
while [ $# -gt 0 ]; do
dir="$1"
dest="$2"
if [ -h "$dir" ]; then
if [ "$(readlink -f $dir)" != "$dest" ]; then
echo "WARNING: removing wrong symlink in /$dir..."
rm -f "$dir"
fi
elif [ -d "$dir" ]; then
echo "WARNING: removing directory /$dir..."
rm -rf "$dir"
fi
if [ ! -e "$dir" ]; then
ln -sf "$dest" "$dir"
fi
shift; shift;
done
;;
esac

View File

@ -1,6 +1,6 @@
# Template file for 'base-directories'
pkgname=base-directories
version=0.14
version=0.15
build_style=custom-install
short_desc="Void GNU/Linux base system directories"
maintainer="Juan RP <xtraeme@gmail.com>"