I'm not sure why line 191 had an error for me, I didn't really
investigate how it works, but replacing it with a simpler method of
removing duplicates fixes the problem:

package.initscripts = list(set(package.initscripts))

Attached is a patch with that change, against the debian-goodies 0.55
version of checkrestart. I added a similar line to remove duplicate init
script listings, which can happen when checkrestart finds that openssh-
client and openssh-server both need to be restarted, /etc/init.d/ssh
will be listed twice, for example. Also, I did a whitespace-cleanup
using emacs.

Note that this usage of set() requires python >= 2.5.
http://docs.python.org/faq/programming.html#how-do-you-remove-
duplicates-from-a-list

** Patch added: "checkrestart-rmdupes-fix.diff"
   
https://bugs.launchpad.net/ubuntu/+source/debian-goodies/+bug/764042/+attachment/2078959/+files/checkrestart-rmdupes-fix.diff

** Tags added: patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/764042

Title:
  natty: checkrestart: line 191, in main: package.initscripts = [ u for
  u in package.initscripts if u not in locals()['_[1]'] ]; KeyError:
  '_[1]'

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to