aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-10-17 09:31:06 +0200
committerGuido Günther <agx@sigxcpu.org>2014-10-17 09:31:06 +0200
commit36fd4eee614a35fece4ccc085af73d92ce5de2a4 (patch)
tree1c9f27abb68d1dd15426eeeeb1092020c0dc8337
parent472cbbd1493cf4a23e9a6ffcdbfac44584ea25ee (diff)
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.
-rw-r--r--debian/preinst14
1 files 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
;;