Package: command-not-found / 0.2.38-1

no-enable-component.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Do not help by telling people which component to activate. It does not work
because we only support activated repositories and because it's somehow broken.
--- a/CommandNotFound/CommandNotFound.py
+++ b/CommandNotFound/CommandNotFound.py
@@ -84,7 +84,6 @@ class CommandNotFound:
         self.components = ['main','universe','contrib','restricted','non-free',
                            'multiverse']
         self.components.reverse()
-        self.sources_list = self._getSourcesList()
         for filename in os.listdir(os.path.sep.join([data_dir, self.programs_dir])):
             self.programs.append(ProgramDatabase(os.path.sep.join([data_dir, self.programs_dir, filename])))
         try:
@@ -205,16 +204,11 @@ class CommandNotFound:
                 print >>sys.stderr, "sudo apt-get install %s" %  packages[0][0]
             else:
                 print >>sys.stderr, _("To run '%(command)s' please ask your administrator to install the package '%(package)s'") % {'command': command, 'package': packages[0][0]}
-            if not packages[0][1] in self.sources_list:
-                print >>sys.stderr, _("You will have to enable the component called '%s'") % packages[0][1]
         elif len(packages) > 1:
             packages.sort(self.sortByComponent)
             print >>sys.stderr, _("The program '%s' can be found in the following packages:") % command
             for package in packages:
-                if package[1] in self.sources_list:
-                    print >>sys.stderr, " * %s" % package[0]
-                else:
-                    print >>sys.stderr, " * %s" % package[0] + " (" + _("You will have to enable component called '%s'") % package[1] + ")"
+                print >>sys.stderr, " * %s" % package[0]
             if posix.geteuid() == 0:
                 print >>sys.stderr, _("Try: %s <selected package>") % "apt-get install"
             elif self.user_can_sudo: