From 36fd4eee614a35fece4ccc085af73d92ce5de2a4 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 17 Oct 2014 09:31:06 +0200 Subject: Avoid error message on missing file Don't try to get the md5sum of a nonexistent file to avoid md5sum: /etc/apt/apt.conf.d/20servicese: No such file or directory which is confusing. --- debian/preinst | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/debian/preinst b/debian/preinst index 1d54ef0..1ea0c9f 100644 --- a/debian/preinst +++ b/debian/preinst @@ -17,12 +17,14 @@ set -e case "$1" in install|upgrade) if dpkg --compare-versions "$2" lt-nl "0.0.8-3~"; then - # Remove backup copies of services file - md5=$(md5sum /etc/apt/apt.conf.d/20servicese | sed -e 's/ .*//') - case "$md5" in - 074e684668c83b8a98c5eeb8257c88f2|509ad2c35aa4da3153dd6e70941e060b) - rm -f /etc/apt/apt.conf.d/20servicese - esac + if [ -f /etc/apt/apt.conf.d/20servicese ]; then + # Remove errnoneous backup copies of services file + md5=$(md5sum /etc/apt/apt.conf.d/20servicese | sed -e 's/ .*//') + case "$md5" in + 074e684668c83b8a98c5eeb8257c88f2|509ad2c35aa4da3153dd6e70941e060b) + rm -f /etc/apt/apt.conf.d/20servicese + esac + fi fi ;; -- cgit v1.2.3