From b10c7b6f652db812a456cbcabf4661e70d02f766 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Mon, 27 May 2019 03:18:06 +0800 Subject: [PATCH] * usr/bin/byobu-janitor.in: - Add fallback if the install command is not available --- debian/changelog | 2 ++ usr/bin/byobu-janitor.in | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 372da95c..e13afd48 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,8 @@ byobu (5.128) unreleased; urgency=medium creating it) * usr/bin/byobu.in: - Use readlink if the tty command is not available + * usr/bin/byobu-janitor.in: + - Add fallback if the install command is not available * usr/bin/byobu-launch.in: - Don't autolaunch for ARM serial consoles * usr/lib/byobu/disk_io: diff --git a/usr/bin/byobu-janitor.in b/usr/bin/byobu-janitor.in index 071b82ca..840f98d4 100755 --- a/usr/bin/byobu-janitor.in +++ b/usr/bin/byobu-janitor.in @@ -41,7 +41,14 @@ DEFAULT_PROFILE="light" PROFILE="$BYOBU_CONFIG_DIR/profile" # Create byobu-exchange buffer file, with secure permissions, if it doesn't exist -[ -e "$BYOBU_RUN_DIR/printscreen" ] || install -m 600 /dev/null "$BYOBU_RUN_DIR/printscreen" +if ! [ -e "$BYOBU_RUN_DIR/printscreen" ]; then + if eval $BYOBU_TEST install >/dev/null 2>&1; then + install -m 600 /dev/null "$BYOBU_RUN_DIR/printscreen" + else + cp /dev/null "$BYOBU_RUN_DIR/printscreen" + chmod 600 "$BYOBU_RUN_DIR/printscreen" + fi +fi # Affects: users who launched using sudo, such that their config dir # is not writable by them