[Pkg-nagios-changes] [pkg-nagios-plugins] 52/413: test for file before md5summing it

Jan Wagner waja at moszumanska.debian.org
Tue Nov 26 23:13:05 UTC 2013


This is an automated email from the git hooks/post-receive script.

waja pushed a commit to branch master
in repository pkg-nagios-plugins.

commit 398bf9d4c0b7fc0aa3610f441c1f131abbbaced5
Author: Sean Finney <seanius at debian.org>
Date:   Wed Dec 6 21:55:29 2006 +0000

    test for file before md5summing it
---
 debian/functions | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/debian/functions b/debian/functions
index 1799355..7cf51da 100644
--- a/debian/functions
+++ b/debian/functions
@@ -6,9 +6,13 @@ npdpkgdir=/usr/share/nagios-plugins/dpkg
 # determine whether the file is the default file shipped in sarge
 # (called as is_pristine_sarge_file foo.cfg)
 is_pristine_sarge_file(){
-	sargemd5=`grep "${npconfdir}/$1" ${npdpkgdir}/sarge.md5sums | cut -d' ' -f1`
-	curmd5=`md5sum "${npconfdir}/$1" | cut -d' ' -f1`
-	if [ "$curmd5" = "$sargemd5" ]; then return 0; else return 1; fi
+	cfg="${npconfdir}/$1"
+	if [ -f "$cfg" ]; then
+		sargemd5=`grep "$cfg" ${npdpkgdir}/sarge.md5sums | cut -d' ' -f1`
+		curmd5=`md5sum "$cfg" | cut -d' ' -f1`
+		if [ "$curmd5" = "$sargemd5" ]; then return 0; fi
+	fi
+	return 1
 }
 
 # we now register all n-p config files via ucf.  this means

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-nagios-plugins.git



More information about the Pkg-nagios-changes mailing list