Package: command-not-found
Version: 0.2.38-1
Followup-For: Bug #703971

Dear Maintainer,
*** Please consider answering these questions, where appropriate ***

   * What led up to the situation?
Installed command-not-found and tested it by running a missing command

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

   * What was the outcome of this action?
I was prompted to ask the administrator to install the missing package

pi@raspi ~ $ meld
The program 'meld' is currently not installed.  To run 'meld' please ask your 
administrator to install the package 'meld'
meld: command not found


   * What outcome did you expect instead?
I was expecting the more useful "sudo apt-get install ..." message

pi@raspi ~ $ meld
The program 'meld' is currently not installed.  You can install it by typing:
sudo apt-get install meld
meld: command not found

*** End of the template - remove these lines ***

The following patch triggers on membership of several groups ('admin ', 'sudo 
', 'adm') rather than just one:


$ diff --unified ./CommandNotFound.py 
/usr/share/command-not-found/CommandNotFound/CommandNotFound.py
--- ./CommandNotFound.py        2013-05-08 23:34:03.372359619 +0930
+++ /usr/share/command-not-found/CommandNotFound/CommandNotFound.py     
2013-05-08 23:34:46.640272545 +0930
@@ -89,10 +89,8 @@
         if not self.programs:
             print _("Could not find the database of available applications, "
                     "run update-command-not-found as root to fix this")
-        try:
-            self.user_can_sudo = grp.getgrnam("admin")[2] in posix.getgroups()
-        except KeyError:
-            self.user_can_sudo = False
+        self.user_can_sudo = bool(set([grp.getgrgid(i).gr_name for i in 
posix.getgroups()]).intersection(('admin ', 'sudo ', 'adm')))
+
 
     def print_spelling_suggestion(self, word, min_len=3, max_len=15):
         " try to correct the spelling "


-- System Information:
Debian Release: 7.0
Architecture: armhf (armv6l)

Kernel: Linux 3.6.11+ (PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages command-not-found depends on:
ii  apt-file        2.5.1
ii  lsb-release     4.1+Debian8+rpi1
ii  python          2.7.3-4
ii  python-gdbm     2.7.3-1
ii  python-support  1.0.15

command-not-found recommends no packages.

command-not-found suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to