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
=== modified file 'CommandNotFound/CommandNotFound.py'
--- CommandNotFound/CommandNotFound.py 2013-06-17 09:00:52 +0000
+++ CommandNotFound/CommandNotFound.py 2015-09-10 11:10:43 +0000
@@ -220,7 +220,7 @@
220 command_prefix = ""220 command_prefix = ""
221 else:221 else:
222 command_prefix = "sudo "222 command_prefix = "sudo "
223 install_command = "%sapt-get install %s" % (command_prefix, package_name)223 install_command = "%sapt install %s" % (command_prefix, package_name)
224 print("%s" % install_command, file=sys.stdout)224 print("%s" % install_command, file=sys.stdout)
225 subprocess.call(install_command.split(), shell=False)225 subprocess.call(install_command.split(), shell=False)
226226
@@ -254,9 +254,9 @@
254 print(_("This is most likely caused by the lack of administrative privileges associated with your user account."), file=sys.stderr)254 print(_("This is most likely caused by the lack of administrative privileges associated with your user account."), file=sys.stderr)
255 return False255 return False
256256
257 # do not give advice if we are in a situation where apt-get257 # do not give advice if we are in a situation where apt
258 # or aptitude are not available (LP: #394843)258 # or aptitude are not available (LP: #394843)
259 if not (os.path.exists("/usr/bin/apt-get") or259 if not (os.path.exists("/usr/bin/apt") or
260 os.path.exists("/usr/bin/aptitude")):260 os.path.exists("/usr/bin/aptitude")):
261 return False261 return False
262262
@@ -269,11 +269,11 @@
269 print(_("The program '%s' is currently not installed. ") % command, end="", file=sys.stderr)269 print(_("The program '%s' is currently not installed. ") % command, end="", file=sys.stderr)
270 if posix.geteuid() == 0:270 if posix.geteuid() == 0:
271 print(_("You can install it by typing:"), file=sys.stderr)271 print(_("You can install it by typing:"), file=sys.stderr)
272 print("apt-get install %s" % packages[0][0], file=sys.stderr)272 print("apt install %s" % packages[0][0], file=sys.stderr)
273 self.install_prompt(packages[0][0])273 self.install_prompt(packages[0][0])
274 elif self.user_can_sudo:274 elif self.user_can_sudo:
275 print(_("You can install it by typing:"), file=sys.stderr)275 print(_("You can install it by typing:"), file=sys.stderr)
276 print("sudo apt-get install %s" % packages[0][0], file=sys.stderr)276 print("sudo apt install %s" % packages[0][0], file=sys.stderr)
277 self.install_prompt(packages[0][0])277 self.install_prompt(packages[0][0])
278 else:278 else:
279 print(_("To run '%(command)s' please ask your administrator to install the package '%(package)s'") % {'command': command, 'package': packages[0][0]}, file=sys.stderr)279 print(_("To run '%(command)s' please ask your administrator to install the package '%(package)s'") % {'command': command, 'package': packages[0][0]}, file=sys.stderr)
@@ -288,9 +288,9 @@
288 else:288 else:
289 print(" * %s" % package[0] + " (" + _("You will have to enable component called '%s'") % package[1] + ")", file=sys.stderr)289 print(" * %s" % package[0] + " (" + _("You will have to enable component called '%s'") % package[1] + ")", file=sys.stderr)
290 if posix.geteuid() == 0:290 if posix.geteuid() == 0:
291 print(_("Try: %s <selected package>") % "apt-get install", file=sys.stderr)291 print(_("Try: %s <selected package>") % "apt install", file=sys.stderr)
292 elif self.user_can_sudo:292 elif self.user_can_sudo:
293 print(_("Try: %s <selected package>") % "sudo apt-get install", file=sys.stderr)293 print(_("Try: %s <selected package>") % "sudo apt install", file=sys.stderr)
294 else:294 else:
295 print(_("Ask your administrator to install one of them"), file=sys.stderr)295 print(_("Ask your administrator to install one of them"), file=sys.stderr)
296 return len(packages) > 0296 return len(packages) > 0

Subscribers

People subscribed via source and target branches