Merge lp:~cjwatson/click/chroot-session-improvements into lp:click/devel

Proposed by Colin Watson
Status: Merged
Merged at revision: 536
Proposed branch: lp:~cjwatson/click/chroot-session-improvements
Merge into: lp:click/devel
Diff against target: 80 lines (+18/-4)
3 files modified
click/commands/chroot.py (+14/-2)
debian/changelog (+2/-0)
doc/manpage.rst (+2/-2)
To merge this branch: bzr merge lp:~cjwatson/click/chroot-session-improvements
Reviewer Review Type Date Requested Status
Michael Vogt Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+238150@code.launchpad.net

Commit message

Allow "click chroot install" and "click chroot upgrade" to operate on sessions.

Description of the change

"click chroot install" and "click chroot upgrade" could easily operate on sessions; they use maint() under the hood which can already do this. This branch adds the option plumbing to make it work.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Vogt (mvo) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'click/commands/chroot.py'
2--- click/commands/chroot.py 2014-09-25 14:26:39 +0000
3+++ click/commands/chroot.py 2014-10-13 12:50:22 +0000
4@@ -72,7 +72,9 @@
5
6 def install(parser, args):
7 packages = args.packages
8- chroot = ClickChroot(args.architecture, args.framework, name=args.name)
9+ chroot = ClickChroot(
10+ args.architecture, args.framework, name=args.name,
11+ session=args.session)
12 with message_on_error(
13 ClickChrootDoesNotExistException, ErrorMessages.NOT_EXISTS):
14 return chroot.install(*packages)
15@@ -120,7 +122,9 @@
16
17
18 def upgrade(parser, args):
19- chroot = ClickChroot(args.architecture, args.framework, name=args.name)
20+ chroot = ClickChroot(
21+ args.architecture, args.framework, name=args.name,
22+ session=args.session)
23 with message_on_error(
24 ClickChrootDoesNotExistException, ErrorMessages.NOT_EXISTS):
25 return chroot.upgrade()
26@@ -194,11 +198,19 @@
27 upgrade_parser = subparsers.add_parser(
28 "upgrade",
29 help="upgrade the chroot")
30+ upgrade_parser.add_argument(
31+ "-n", "--session-name",
32+ dest='session',
33+ help="persistent chroot session name to upgrade")
34 upgrade_parser.set_defaults(func=upgrade)
35 install_parser = subparsers.add_parser(
36 "install",
37 help="install packages in the chroot")
38 install_parser.add_argument(
39+ "-n", "--session-name",
40+ dest='session',
41+ help="persistent chroot session name to install packages in")
42+ install_parser.add_argument(
43 "packages", nargs="+",
44 help="packages to install")
45 install_parser.set_defaults(func=install)
46
47=== modified file 'debian/changelog'
48--- debian/changelog 2014-10-13 12:34:43 +0000
49+++ debian/changelog 2014-10-13 12:50:22 +0000
50@@ -8,6 +8,8 @@
51 * Make "click info" always try opening the input file as a package and
52 only try to interpret it as a file in an installed package if that
53 fails, rather than guessing by the input file extension.
54+ * Allow "click chroot install" and "click chroot upgrade" to operate on
55+ sessions.
56
57 [ Pete Woods ]
58 * Include Canonical's cmake-extras project in the schroot.
59
60=== modified file 'doc/manpage.rst'
61--- doc/manpage.rst 2014-09-10 11:50:18 +0000
62+++ doc/manpage.rst 2014-10-13 12:50:22 +0000
63@@ -124,7 +124,7 @@
64 end-session SESSION
65 End a persistent chroot session.
66
67-install PACKAGES
68+install [-n SESSION] PACKAGES
69 Install packages in the chroot.
70
71 maint [-n SESSION] COMMAND ARGUMENTS
72@@ -143,7 +143,7 @@
73 session must previously have been created by ``click chroot
74 begin-session``.
75
76-upgrade
77+upgrade [-n SESSION]
78 Upgrade the chroot.
79
80 click contents PATH

Subscribers

People subscribed via source and target branches

to all changes: