Merge lp:~cjwatson/click/info-extension into lp:click

Proposed by Colin Watson
Status: Superseded
Proposed branch: lp:~cjwatson/click/info-extension
Merge into: lp:click
Diff against target: 79 lines (+26/-5)
4 files modified
click/commands/info.py (+2/-2)
click/tests/integration/test_info.py (+9/-1)
debian/changelog (+13/-0)
debian/control (+2/-2)
To merge this branch: bzr merge lp:~cjwatson/click/info-extension
Reviewer Review Type Date Requested Status
click hackers Pending
Review via email: mp+237384@code.launchpad.net

This proposal has been superseded by a proposal from 2014-10-07.

Commit message

Make "click info" always try opening the input file as a package and only try to interpret it as a file in an installed package if that fails, rather than guessing by the input file extension.

Description of the change

Make "click info" always try opening the input file as a package and only try to interpret it as a file in an installed package if that fails, rather than guessing by the input file extension.

This fixes attempts to install packages that don't end with ".click" via "pkcon install-local", broken by the fix for bug 1324853.

To post a comment you must log in.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'click/commands/info.py'
2--- click/commands/info.py 2014-08-08 10:13:30 +0000
3+++ click/commands/info.py 2014-10-07 09:15:11 +0000
4@@ -49,12 +49,12 @@
5 if registry.has_package_name(arg):
6 return json_object_to_python(registry.get_manifest(arg))
7
8- if arg.endswith(".click"):
9+ try:
10 with closing(DebFile(filename=arg)) as package:
11 with package.control.get_file(
12 "manifest", encoding="UTF-8") as manifest_file:
13 return _load_manifest(manifest_file)
14- else:
15+ except Exception:
16 pkgdir = Click.find_package_directory(arg)
17 manifest_path = glob.glob(
18 os.path.join(pkgdir, ".click", "info", "*.manifest"))
19
20=== modified file 'click/tests/integration/test_info.py'
21--- click/tests/integration/test_info.py 2014-09-05 09:08:31 +0000
22+++ click/tests/integration/test_info.py 2014-10-07 09:15:11 +0000
23@@ -30,7 +30,6 @@
24 self.click_binary, "info", path_to_click], universal_newlines=True)
25 self.assertEqual(name, json.loads(output)["name"])
26
27-
28 def test_info_installed_click(self):
29 name = "com.example.foo"
30 user = os.environ.get("USER", "root")
31@@ -55,3 +54,12 @@
32 "/opt/click.ubuntu.com/%s/%s/README" % (name, version)],
33 universal_newlines=True)
34 self.assertEqual(name, json.loads(output)["name"])
35+
36+ def test_info_different_extension(self):
37+ name = "org.example.info"
38+ raw_path = self._make_click(name)
39+ path = "%s.extra" % raw_path
40+ os.rename(raw_path, path)
41+ output = subprocess.check_output([
42+ self.click_binary, "info", path], universal_newlines=True)
43+ self.assertEqual(name, json.loads(output)["name"])
44
45=== modified file 'debian/changelog'
46--- debian/changelog 2014-09-29 14:18:41 +0000
47+++ debian/changelog 2014-10-07 09:15:11 +0000
48@@ -1,3 +1,16 @@
49+click (0.4.34) UNRELEASED; urgency=medium
50+
51+ [ Michael Vogt ]
52+ * Demote ubuntu-app-launch-tools from a click recommends to a suggests,
53+ since they are not needed on server installs.
54+
55+ [ Colin Watson ]
56+ * Make "click info" always try opening the input file as a package and
57+ only try to interpret it as a file in an installed package if that
58+ fails, rather than guessing by the input file extension.
59+
60+ -- Colin Watson <cjwatson@ubuntu.com> Wed, 01 Oct 2014 12:28:42 +0100
61+
62 click (0.4.33) utopic; urgency=medium
63
64 [ Pete Woods ]
65
66=== modified file 'debian/control'
67--- debian/control 2014-09-05 09:39:06 +0000
68+++ debian/control 2014-10-07 09:15:11 +0000
69@@ -15,8 +15,8 @@
70 Architecture: any
71 Pre-Depends: ${misc:Pre-Depends}
72 Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}, python3-click (= ${binary:Version}), adduser
73-Recommends: click-apparmor, ubuntu-app-launch-tools | upstart-app-launch-tools
74-Suggests: click-reviewers-tools (>= 0.9)
75+Recommends: click-apparmor
76+Suggests: click-reviewers-tools (>= 0.9), ubuntu-app-launch-tools | upstart-app-launch-tools
77 Conflicts: click-package
78 Replaces: click-package
79 Provides: click-package

Subscribers

People subscribed via source and target branches

to all changes: