Merge lp:~laney/bamf/prefix-regex-python into lp:bamf

Proposed by Iain Lane
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 600
Merged at revision: 600
Proposed branch: lp:~laney/bamf/prefix-regex-python
Merge into: lp:bamf
Diff against target: 27 lines (+5/-1)
2 files modified
src/bamf-matcher.c (+1/-1)
tests/bamfdaemon/test-matcher.c (+4/-0)
To merge this branch: bzr merge lp:~laney/bamf/prefix-regex-python
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Marco Trevisan (Treviño) Approve
Review via email: mp+214995@code.launchpad.net

Commit message

BamfMatcher: fix prefix regex for pythonX support

Fix preifx regex (used for converting /usr/bin/python[stuff] foo into foo) to work with pythonX as well as python and pythonX.Y

Description of the change

gnome-language-selector wasn't being matched because its interpreter was /usr/bin/python3 which the regex didn't cover

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Thanks!

review: Approve
Revision history for this message
Sebastien Bacher (seb128) wrote :

looks fine to me, thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/bamf-matcher.c'
2--- src/bamf-matcher.c 2014-04-08 14:37:26 +0000
3+++ src/bamf-matcher.c 2014-04-09 17:08:27 +0000
4@@ -55,7 +55,7 @@
5 const gchar* EXEC_BAD_PREFIXES[] =
6 {
7 "^gksu(do)?$", "^sudo$", "^su-to-root$", "^amdxdg-su$", "^java(ws)?$", "^cli$",
8- "^mono$", "^ruby$", "^padsp$", "^aoss$", "^python(\\d.\\d)?$", "^(ba)?sh$",
9+ "^mono$", "^ruby$", "^padsp$", "^aoss$", "^python(\\d(\\.\\d)?)?$", "^(ba)?sh$",
10 "^perl$", "^env$", "^xdg-open$", "^qmlscene$", "^qmlviewer$",
11 "^unity-webapps-runner$", "^webapp-container$",
12 /* javaws strings: */ "^net\\.sourceforge\\.jnlp\\.runtime\\.Boot$", "^rt\\.jar$",
13
14=== modified file 'tests/bamfdaemon/test-matcher.c'
15--- tests/bamfdaemon/test-matcher.c 2013-08-07 15:58:31 +0000
16+++ tests/bamfdaemon/test-matcher.c 2014-04-09 17:08:27 +0000
17@@ -1040,6 +1040,10 @@
18 g_assert_cmpstr (trimmed, ==, "bad-prefix-script");
19 g_free (trimmed);
20
21+ trimmed = bamf_matcher_get_trimmed_exec (matcher, "/usr/bin/python3 /usr/bin/gnome-language-selector");
22+ g_assert_cmpstr (trimmed, ==, "gnome-language-selector");
23+ g_free (trimmed);
24+
25 trimmed = bamf_matcher_get_trimmed_exec (matcher, "/usr/bin/python3.1");
26 g_assert_cmpstr (trimmed, ==, "python3.1");
27 g_free (trimmed);

Subscribers

People subscribed via source and target branches

to all changes: