From 20b74e97e6694384a810ef0271216994340a8e79 Mon Sep 17 00:00:00 2001 From: Vitaly Lipatov <lav@etersoft.ru> Date: Sun, 13 Oct 2013 17:37:26 +0400 Subject: [PATCH] epm: use eatmydata if installed (set EPMNOEATMYDATA for skip) --- bin/epm | 1 + bin/epm-sh-functions | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/bin/epm b/bin/epm index 4b8992c..dcf8862 100755 --- a/bin/epm +++ b/bin/epm @@ -37,6 +37,7 @@ load_helper epm-sh-functions #PATH=$PATH:/sbin:/usr/sbin set_sudo +set_eatmydata check_tty diff --git a/bin/epm-sh-functions b/bin/epm-sh-functions index 9faef65..99a0ab8 100644 --- a/bin/epm-sh-functions +++ b/bin/epm-sh-functions @@ -219,6 +219,16 @@ set_sudo() SUDO="fatal 'Can't find sudo. Please install sudo or run epm under root.'" } +set_eatmydata() +{ + # skip if disabled + [ -n "$EPMNOEATMYDATA" ] && return + # use if possible + which eatmydata >/dev/null 2>/dev/null || return + SUDO="$SUDO eatmydata" + echo "Uwaga! eatmydata is installed, we will use it for disable all sync operations." +} + assure_exists() { PATH=$PATH:/sbin:/usr/sbin which $1 2>/dev/null >/dev/null && return -- 2.24.1