Merge lp:~larryprice/url-dispatcher/appid-with-dots into lp:url-dispatcher/touch-vivid

Proposed by Ted Gould
Status: Approved
Approved by: Ted Gould
Approved revision: 93
Proposed branch: lp:~larryprice/url-dispatcher/appid-with-dots
Merge into: lp:url-dispatcher/touch-vivid
Diff against target: 79 lines (+17/-6)
3 files modified
CMakeLists.txt (+4/-5)
service/dispatcher.c (+1/-1)
tests/app-id-test.cc (+12/-0)
To merge this branch: bzr merge lp:~larryprice/url-dispatcher/appid-with-dots
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+310205@code.launchpad.net

Commit message

App ID should allow package names with dots.

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

Backporting to vivid. Same review.

review: Approve

Unmerged revisions

93. By Larry Price

Adding test

92. By Larry Price

Accept '.' in appid for libertine apps

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2015-06-11 21:38:13 +0000
+++ CMakeLists.txt 2016-11-07 16:40:58 +0000
@@ -3,7 +3,7 @@
33
4string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower) # Build types should always be lowercase but sometimes they are not.4string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower) # Build types should always be lowercase but sometimes they are not.
55
6if (${cmake_build_type_lower} STREQUAL debug)6if ("${cmake_build_type_lower}" STREQUAL "debug")
7 option (werror "Treat warnings as errors." FALSE)7 option (werror "Treat warnings as errors." FALSE)
8else()8else()
9 option (werror "Treat warnings as errors." TRUE)9 option (werror "Treat warnings as errors." TRUE)
@@ -30,7 +30,7 @@
30include(UseConstantBuilder)30include(UseConstantBuilder)
3131
32# Workaround for libexecdir on debian32# Workaround for libexecdir on debian
33if (EXISTS "/etc/debian_version") 33if (EXISTS "/etc/debian_version")
34 set(CMAKE_INSTALL_LIBEXECDIR ${CMAKE_INSTALL_LIBDIR})34 set(CMAKE_INSTALL_LIBEXECDIR ${CMAKE_INSTALL_LIBDIR})
35 set(CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBEXECDIR}")35 set(CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBEXECDIR}")
36endif()36endif()
@@ -42,7 +42,7 @@
42# Since gdbus-codegen does not produce warning-free code42# Since gdbus-codegen does not produce warning-free code
43# and we use -Werror, only enable these warnings for debug43# and we use -Werror, only enable these warnings for debug
44# builds. Drop this once the issue has been fixed and landed.44# builds. Drop this once the issue has been fixed and landed.
45if (${cmake_build_type_lower} STREQUAL debug)45if ("${cmake_build_type_lower}" STREQUAL debug)
46 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpedantic")# -Wextra")46 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpedantic")# -Wextra")
47 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic -Wextra")47 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic -Wextra")
48endif()48endif()
@@ -50,7 +50,7 @@
50if (${werror})50if (${werror})
51 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")51 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
52 set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -Werror")52 set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
53endif() 53endif()
5454
55pkg_check_modules(UBUNTU_APP_LAUNCH REQUIRED ubuntu-app-launch-2>=0.5)55pkg_check_modules(UBUNTU_APP_LAUNCH REQUIRED ubuntu-app-launch-2>=0.5)
56include_directories(${UBUNTU_APP_LAUNCH_INCLUDE_DIRS})56include_directories(${UBUNTU_APP_LAUNCH_INCLUDE_DIRS})
@@ -115,4 +115,3 @@
115 endif ()115 endif ()
116 add_subdirectory(tests)116 add_subdirectory(tests)
117endif ()117endif ()
118
119118
=== modified file 'service/dispatcher.c'
--- service/dispatcher.c 2015-09-03 21:50:06 +0000
+++ service/dispatcher.c 2016-11-07 16:40:58 +0000
@@ -556,7 +556,7 @@
556 g_return_val_if_fail(urldb != NULL, FALSE);556 g_return_val_if_fail(urldb != NULL, FALSE);
557557
558 applicationre = g_regex_new("^application:///([a-zA-Z0-9_\\.-]*)\\.desktop$", 0, 0, NULL);558 applicationre = g_regex_new("^application:///([a-zA-Z0-9_\\.-]*)\\.desktop$", 0, 0, NULL);
559 appidre = g_regex_new("^appid://([a-z0-9\\.-]*)/([a-zA-Z0-9-]*)/([a-zA-Z0-9\\.-]*)$", 0, 0, NULL);559 appidre = g_regex_new("^appid://([a-z0-9\\.-]*)/([a-zA-Z0-9-\\.]*)/([a-zA-Z0-9\\.-]*)$", 0, 0, NULL);
560 genericre = g_regex_new("^([a-z][a-z0-9]*):(?://(?:.*@)?([a-zA-Z0-9\\.-]*)(?::[0-9]*)?/?)?(.*)?$", 0, 0, NULL);560 genericre = g_regex_new("^([a-z][a-z0-9]*):(?://(?:.*@)?([a-zA-Z0-9\\.-]*)(?::[0-9]*)?/?)?(.*)?$", 0, 0, NULL);
561 intentre = g_regex_new("^intent://.*package=([a-zA-Z0-9\\.]*);.*$", 0, 0, NULL);561 intentre = g_regex_new("^intent://.*package=([a-zA-Z0-9\\.]*);.*$", 0, 0, NULL);
562562
563563
=== modified file 'tests/app-id-test.cc'
--- tests/app-id-test.cc 2015-05-15 21:24:15 +0000
+++ tests/app-id-test.cc 2016-11-07 16:40:58 +0000
@@ -88,6 +88,18 @@
88 g_clear_pointer(&out_appid, g_free);88 g_clear_pointer(&out_appid, g_free);
89 out_url = nullptr;89 out_url = nullptr;
9090
91 /* App ID with periods */
92 dispatcher_url_to_appid("appid://container-id/org.canonical.app1/0.0", &out_appid, &out_url);
93 ASSERT_STREQ("container-id_org.canonical.app1_0.0", out_appid);
94 EXPECT_EQ(nullptr, out_url);
95
96 dispatcher_send_to_app(out_appid, out_url);
97 EXPECT_STREQ("container-id_org.canonical.app1_0.0", ubuntu_app_launch_mock_get_last_app_id());
98
99 ubuntu_app_launch_mock_clear_last_app_id();
100 g_clear_pointer(&out_appid, g_free);
101 out_url = nullptr;
102
91 /* No version at all */103 /* No version at all */
92 dispatcher_url_to_appid("appid://com.test.good/app1", &out_appid, &out_url);104 dispatcher_url_to_appid("appid://com.test.good/app1", &out_appid, &out_url);
93105

Subscribers

People subscribed via source and target branches