From 493f8445c8a23c8661087bfe44097b86b4ba59cf Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sat, 22 Oct 2011 02:19:33 -0500 Subject: [PATCH] search and use a shared dir when possible --- debian/changelog | 1 + usr/lib/byobu/.dirs | 14 ++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9d86fdeb..0f051b68 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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- diff --git a/usr/lib/byobu/.dirs b/usr/lib/byobu/.dirs index 51228edd..6726a3a9 100755 --- a/usr/lib/byobu/.dirs +++ b/usr/lib/byobu/.dirs @@ -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)