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

Subscribers

People subscribed via source and target branches

to all changes: