Merge lp:~xnox/command-not-found/apt-get-is-dead into lp:~command-not-found-developers/command-not-found/trunk

Proposed by Dimitri John Ledkov
Status: Merged
Merged at revision: 157
Proposed branch: lp:~xnox/command-not-found/apt-get-is-dead
Merge into: lp:~command-not-found-developers/command-not-found/trunk
Diff against target: 50 lines (+7/-7)
1 file modified
CommandNotFound/CommandNotFound.py (+7/-7)
To merge this branch: bzr merge lp:~xnox/command-not-found/apt-get-is-dead
Reviewer Review Type Date Requested Status
Zygmunt Krynicki Approve
Michael Vogt Pending
Review via email: mp+270652@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CommandNotFound/CommandNotFound.py'
2--- CommandNotFound/CommandNotFound.py 2013-06-17 09:00:52 +0000
3+++ CommandNotFound/CommandNotFound.py 2015-09-10 11:10:43 +0000
4@@ -220,7 +220,7 @@
5 command_prefix = ""
6 else:
7 command_prefix = "sudo "
8- install_command = "%sapt-get install %s" % (command_prefix, package_name)
9+ install_command = "%sapt install %s" % (command_prefix, package_name)
10 print("%s" % install_command, file=sys.stdout)
11 subprocess.call(install_command.split(), shell=False)
12
13@@ -254,9 +254,9 @@
14 print(_("This is most likely caused by the lack of administrative privileges associated with your user account."), file=sys.stderr)
15 return False
16
17- # do not give advice if we are in a situation where apt-get
18+ # do not give advice if we are in a situation where apt
19 # or aptitude are not available (LP: #394843)
20- if not (os.path.exists("/usr/bin/apt-get") or
21+ if not (os.path.exists("/usr/bin/apt") or
22 os.path.exists("/usr/bin/aptitude")):
23 return False
24
25@@ -269,11 +269,11 @@
26 print(_("The program '%s' is currently not installed. ") % command, end="", file=sys.stderr)
27 if posix.geteuid() == 0:
28 print(_("You can install it by typing:"), file=sys.stderr)
29- print("apt-get install %s" % packages[0][0], file=sys.stderr)
30+ print("apt install %s" % packages[0][0], file=sys.stderr)
31 self.install_prompt(packages[0][0])
32 elif self.user_can_sudo:
33 print(_("You can install it by typing:"), file=sys.stderr)
34- print("sudo apt-get install %s" % packages[0][0], file=sys.stderr)
35+ print("sudo apt install %s" % packages[0][0], file=sys.stderr)
36 self.install_prompt(packages[0][0])
37 else:
38 print(_("To run '%(command)s' please ask your administrator to install the package '%(package)s'") % {'command': command, 'package': packages[0][0]}, file=sys.stderr)
39@@ -288,9 +288,9 @@
40 else:
41 print(" * %s" % package[0] + " (" + _("You will have to enable component called '%s'") % package[1] + ")", file=sys.stderr)
42 if posix.geteuid() == 0:
43- print(_("Try: %s <selected package>") % "apt-get install", file=sys.stderr)
44+ print(_("Try: %s <selected package>") % "apt install", file=sys.stderr)
45 elif self.user_can_sudo:
46- print(_("Try: %s <selected package>") % "sudo apt-get install", file=sys.stderr)
47+ print(_("Try: %s <selected package>") % "sudo apt install", file=sys.stderr)
48 else:
49 print(_("Ask your administrator to install one of them"), file=sys.stderr)
50 return len(packages) > 0

Subscribers

People subscribed via source and target branches