Merge lp:~jamesh/archive-index/app-install into lp:~mvo/archive-index/app-install-mvo

Proposed by Dimitri John Ledkov
Status: Merged
Merged at revision: 21
Proposed branch: lp:~jamesh/archive-index/app-install
Merge into: lp:~mvo/archive-index/app-install-mvo
Diff against target: 87 lines (+18/-5)
5 files modified
src/DesktopFinder/__init__.py (+5/-3)
tests/archive/dists/test/Contents-foo (+3/-0)
tests/archive/dists/test/main/binary-foo/Packages (+5/-0)
tests/test_desktop_finder.py (+2/-1)
tests/test_extract_app_metadata.py (+3/-1)
To merge this branch: bzr merge lp:~jamesh/archive-index/app-install
Reviewer Review Type Date Requested Status
Michael Vogt Approve
Dimitri John Ledkov Pending
Review via email: mp+155700@code.launchpad.net

Description of the change

In addition to desktop files, also extract scope files from the archive. The test suite was erroring out for me with urllib errors, so I can't say whether all the tests pass.

When software center currently scans the app-install directories, it searches for files matching the "*.desktop" glob, so this should not cause any incompatibilities (it does mean that software-center needs to know about the files though).

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Looks fine, thanks a lot !

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/DesktopFinder/__init__.py'
2--- src/DesktopFinder/__init__.py 2011-06-24 19:56:58 +0000
3+++ src/DesktopFinder/__init__.py 2013-03-27 10:45:28 +0000
4@@ -3,6 +3,7 @@
5
6 # the directory that lists every valid app
7 _APPS_DIR = "usr/share/applications"
8+_SCOPES_DIR = "usr/share/unity/scopes"
9
10
11 class DesktopFinder:
12@@ -18,7 +19,8 @@
13 @index: A ContentsIndex with this finder's prefixes indexed
14 @returns list of ('packagename', 'path/to/entry') pairs
15 """
16- pattern = ".*\.desktop$"
17- return cache.search(pattern, _APPS_DIR)
18+ result = cache.search(r".*\.desktop$", _APPS_DIR)
19+ result.extend(cache.search(r".*\.scope$", _SCOPES_DIR))
20+ return result
21
22- prefixes = (_APPS_DIR,)
23+ prefixes = (_APPS_DIR, _SCOPES_DIR)
24
25=== modified file 'tests/archive/dists/test/Contents-foo'
26--- tests/archive/dists/test/Contents-foo 2011-06-24 19:56:58 +0000
27+++ tests/archive/dists/test/Contents-foo 2013-03-27 10:45:28 +0000
28@@ -6,6 +6,7 @@
29 bin/bin-bin alt/multibin-pkg
30 sbin/sbin alt/multibin-pkg
31 usr/bin/foreign-icon-app alt/foreign-icon-app
32+usr/bin/some-scope main/some-scope
33 usr/bin/standard-app main/standard-app
34 usr/bin/standard-app main/renamed-app
35 usr/bin/usr-bin alt/multibin-pkg
36@@ -15,4 +16,6 @@
37 usr/share/applications/foreign-icon-app.desktop alt/foreign-icon-app
38 usr/share/applications/standard-app.desktop main/standard-app
39 usr/share/icons/hicolor/64x64/apps/foreign-icon.png alt/foreign-icon-pkg
40+usr/share/icons/hicolor/64x64/apps/some-scope.png main/some-scope
41 usr/share/icons/hicolor/64x64/apps/standard-app.png main/standard-app
42+usr/share/unity/scopes/some-scope.scope main/some-scope
43
44=== modified file 'tests/archive/dists/test/main/binary-foo/Packages'
45--- tests/archive/dists/test/main/binary-foo/Packages 2011-06-24 19:56:58 +0000
46+++ tests/archive/dists/test/main/binary-foo/Packages 2013-03-27 10:45:28 +0000
47@@ -13,3 +13,8 @@
48 Filename: pool/main/standard/standard-app_1.0-1_foo.deb
49 MD5sum: a94aadee76c8ba9d2e843136d2e57849
50
51+Package: some-scope
52+Architecture: foo
53+Filename: pool/main/some-scope/some-scope_1.0-1_foo.deb
54+MD5sum: 9f1e8f95c115f6bfdddee4937758dafb
55+
56
57=== added directory 'tests/archive/pool/main/some-scope'
58=== added file 'tests/archive/pool/main/some-scope/some-scope_1.0-1_foo.deb'
59Binary files tests/archive/pool/main/some-scope/some-scope_1.0-1_foo.deb 1970-01-01 00:00:00 +0000 and tests/archive/pool/main/some-scope/some-scope_1.0-1_foo.deb 2013-03-27 10:45:28 +0000 differ
60=== modified file 'tests/test_desktop_finder.py'
61--- tests/test_desktop_finder.py 2011-06-24 19:56:58 +0000
62+++ tests/test_desktop_finder.py 2013-03-27 10:45:28 +0000
63@@ -13,7 +13,8 @@
64 # all desktop files of architecture 'foo'
65 ("alt-standard-app", "usr/share/applications/a/standard-app.desktop"),
66 ("foreign-icon-app", "usr/share/applications/foreign-icon-app.desktop"),
67- ("standard-app", "usr/share/applications/standard-app.desktop"))
68+ ("standard-app", "usr/share/applications/standard-app.desktop"),
69+ ("some-scope", "usr/share/unity/scopes/some-scope.scope"))
70
71
72 class DesktopFinderTest(unittest.TestCase):
73
74=== modified file 'tests/test_extract_app_metadata.py'
75--- tests/test_extract_app_metadata.py 2011-08-03 01:49:43 +0000
76+++ tests/test_extract_app_metadata.py 2013-03-27 10:45:28 +0000
77@@ -19,7 +19,9 @@
78 "no-icon-app:no-icon-app.desktop": ("X-AppInstall-Package", "no-icon-app"),
79 "rel-path-app:rel-path-app.desktop": ("Icon", "rel-path-app"),
80 "symlink-icon-app:symlink-icon-app.desktop":
81- ("Icon", "_usr_share_icons_symlink-to-usrlibsym_symlink-icon-app")}
82+ ("Icon", "_usr_share_icons_symlink-to-usrlibsym_symlink-icon-app"),
83+ "some-scope:some-scope.scope": ("Name", "Some Scope"),
84+}
85
86 ICONS = (
87 "foreign-icon.png", "rel-path-app.png", "standard-app.png",

Subscribers

People subscribed via source and target branches

to all changes: