search and use a shared dir when possible

This commit is contained in:
Dustin Kirkland 2011-10-22 02:19:33 -05:00
commit 493f8445c8
2 changed files with 7 additions and 8 deletions

1
debian/changelog vendored
View file

@ -18,6 +18,7 @@ byobu (4.43) unreleased; urgency=low
- ensure launcher command removed from each file before installing
* usr/lib/byobu/.dirs:
- use /dev/shm for cache, LP: #872551
- search and use a shared dir when possible
[ Daniel Hahler ]
* usr/bin/byobu, usr/bin/byobu-launcher-install, usr/bin/byobu-

View file

@ -40,14 +40,12 @@ fi
# Create and export the runtime cache directory
if [ -w /dev/shm ]; then
# Use shm for performance, if possible
if [ -z "$BYOBU_RUN_DIR" ]; then
for i in /dev/shm/$PKG-$USER-*; do
if [ -d "$i" ] && [ -O "$i" ]; then
export BYOBU_RUN_DIR="$i"
break
fi
done
fi
for i in /dev/shm/$PKG-$USER-*; do
if [ -d "$i" ] && [ -O "$i" ]; then
export BYOBU_RUN_DIR="$i"
break
fi
done
# Still empty, make a new one
if [ ! -d "$BYOBU_RUN_DIR" ] || [ ! -O "$BYOBU_RUN_DIR" ]; then
export BYOBU_RUN_DIR=$(mktemp -d /dev/shm/$PKG-$USER-XXXXXXXX)