From a2ac15da56e6d08c734f91f97e13e09e59f8c5a2 Mon Sep 17 00:00:00 2001 From: Trace Date: Mon, 27 Apr 2015 17:45:59 -0500 Subject: [PATCH 1/2] Added dpkg rule For example, when using ```dpkg -i some-pkg.deb``` --- thefuck/rules/sudo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/thefuck/rules/sudo.py b/thefuck/rules/sudo.py index 2588ee5..26d87ad 100644 --- a/thefuck/rules/sudo.py +++ b/thefuck/rules/sudo.py @@ -7,7 +7,8 @@ patterns = ['permission denied', 'root privilege', 'This command has to be run under the root user.', 'This operation requires root.', - 'You need to be root to perform this command.'] + 'You need to be root to perform this command.', + 'requested operation requires superuser privilege'] def match(command, settings): From d3295e6a4e18b6e0be45f08fa95d413f4d1c871c Mon Sep 17 00:00:00 2001 From: Trace Date: Tue, 28 Apr 2015 11:59:15 -0500 Subject: [PATCH 2/2] Hoping this fixes the issue of it not working. Still new to this project. My problem of it not working (I admit to being at fault) was that I had not added the same rule to the test case. --- tests/rules/test_sudo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/rules/test_sudo.py b/tests/rules/test_sudo.py index 6bac882..9d77392 100644 --- a/tests/rules/test_sudo.py +++ b/tests/rules/test_sudo.py @@ -5,7 +5,8 @@ from tests.utils import Command @pytest.mark.parametrize('stderr', ['Permission denied', 'permission denied', - "npm ERR! Error: EACCES, unlink"]) + "npm ERR! Error: EACCES, unlink", + 'requested operation requires superuser privilege']) def test_match(stderr): assert match(Command(stderr=stderr), None)