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
=== modified file 'click/commands/chroot.py'
--- click/commands/chroot.py 2014-09-25 14:26:39 +0000
+++ click/commands/chroot.py 2014-10-13 12:50:22 +0000
@@ -72,7 +72,9 @@
7272
73def install(parser, args):73def install(parser, args):
74 packages = args.packages74 packages = args.packages
75 chroot = ClickChroot(args.architecture, args.framework, name=args.name)75 chroot = ClickChroot(
76 args.architecture, args.framework, name=args.name,
77 session=args.session)
76 with message_on_error(78 with message_on_error(
77 ClickChrootDoesNotExistException, ErrorMessages.NOT_EXISTS):79 ClickChrootDoesNotExistException, ErrorMessages.NOT_EXISTS):
78 return chroot.install(*packages)80 return chroot.install(*packages)
@@ -120,7 +122,9 @@
120122
121123
122def upgrade(parser, args):124def upgrade(parser, args):
123 chroot = ClickChroot(args.architecture, args.framework, name=args.name)125 chroot = ClickChroot(
126 args.architecture, args.framework, name=args.name,
127 session=args.session)
124 with message_on_error(128 with message_on_error(
125 ClickChrootDoesNotExistException, ErrorMessages.NOT_EXISTS):129 ClickChrootDoesNotExistException, ErrorMessages.NOT_EXISTS):
126 return chroot.upgrade()130 return chroot.upgrade()
@@ -194,11 +198,19 @@
194 upgrade_parser = subparsers.add_parser(198 upgrade_parser = subparsers.add_parser(
195 "upgrade",199 "upgrade",
196 help="upgrade the chroot")200 help="upgrade the chroot")
201 upgrade_parser.add_argument(
202 "-n", "--session-name",
203 dest='session',
204 help="persistent chroot session name to upgrade")
197 upgrade_parser.set_defaults(func=upgrade)205 upgrade_parser.set_defaults(func=upgrade)
198 install_parser = subparsers.add_parser(206 install_parser = subparsers.add_parser(
199 "install",207 "install",
200 help="install packages in the chroot")208 help="install packages in the chroot")
201 install_parser.add_argument(209 install_parser.add_argument(
210 "-n", "--session-name",
211 dest='session',
212 help="persistent chroot session name to install packages in")
213 install_parser.add_argument(
202 "packages", nargs="+",214 "packages", nargs="+",
203 help="packages to install")215 help="packages to install")
204 install_parser.set_defaults(func=install)216 install_parser.set_defaults(func=install)
205217
=== modified file 'debian/changelog'
--- debian/changelog 2014-10-13 12:34:43 +0000
+++ debian/changelog 2014-10-13 12:50:22 +0000
@@ -8,6 +8,8 @@
8 * Make "click info" always try opening the input file as a package and8 * 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 that9 only try to interpret it as a file in an installed package if that
10 fails, rather than guessing by the input file extension.10 fails, rather than guessing by the input file extension.
11 * Allow "click chroot install" and "click chroot upgrade" to operate on
12 sessions.
1113
12 [ Pete Woods ]14 [ Pete Woods ]
13 * Include Canonical's cmake-extras project in the schroot.15 * Include Canonical's cmake-extras project in the schroot.
1416
=== modified file 'doc/manpage.rst'
--- doc/manpage.rst 2014-09-10 11:50:18 +0000
+++ doc/manpage.rst 2014-10-13 12:50:22 +0000
@@ -124,7 +124,7 @@
124end-session SESSION124end-session SESSION
125 End a persistent chroot session.125 End a persistent chroot session.
126126
127install PACKAGES127install [-n SESSION] PACKAGES
128 Install packages in the chroot.128 Install packages in the chroot.
129129
130maint [-n SESSION] COMMAND ARGUMENTS130maint [-n SESSION] COMMAND ARGUMENTS
@@ -143,7 +143,7 @@
143 session must previously have been created by ``click chroot143 session must previously have been created by ``click chroot
144 begin-session``.144 begin-session``.
145145
146upgrade146upgrade [-n SESSION]
147 Upgrade the chroot.147 Upgrade the chroot.
148148
149click contents PATH149click contents PATH

Subscribers

People subscribed via source and target branches

to all changes: