diff --git a/checkrestart b/checkrestart index b236d41..d535f2b 100755 --- a/checkrestart +++ b/checkrestart @@ -534,7 +534,13 @@ #m = re.search(r'^(([/]\w*){1,5})\s.*$', cmdline.read()) data = cmdline.read().split('\x00') if not data[-1]: data.pop() - data = data[len(data)>=2].split() + # Strip first value, the interpreter + data.pop(0) + # Strip all options following the interpreter, e.g. python's -O + m = re.match("^-", data[0]) + while (m): + data.pop(0) + m = re.match("^-", data[0]) if data and data[0]: data = data[0] data = self.which(data) m = re.search(r'^(/usr/\S+)$', data) diff --git a/debian/changelog b/debian/changelog index 9209855..256fbf2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -23,6 +23,7 @@ - Check ignorelist for package name equality, not substring match. Thanks Francesco Poli! (Closes: #696533) - Also ignore log and temp files under /var/local/ (Closes: #695151) + - Ignore options between interpreter and script name (Closes: #678635) * Bump debhelper compatibility to 9 to be able to use some more recent features. Update versioned debhelper build-dependency accordingly. * Revamp debian/rules