Roger Leigh <[EMAIL PROTECTED]> writes: > I've committed the attached patch into SVN
Now actually attached! -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/ `- GPG Public Key: 0x25BFB848 Please sign and encrypt your mail.
Index: dchroot/dchroot-options.cc
===================================================================
--- dchroot/dchroot-options.cc (revision 845)
+++ dchroot/dchroot-options.cc (working copy)
@@ -77,10 +77,6 @@
if (vm.count("preserve-environment"))
this->preserve = true;
- // dchroot only allows one command.
- if (this->command.size() > 1)
- throw opt::validation_error(_("Only one command may be specified"));
-
if (this->quiet && this->verbose)
{
sbuild::log_warning()
Index: dchroot/dchroot.1.in
===================================================================
--- dchroot/dchroot.1.in (revision 845)
+++ dchroot/dchroot.1.in (working copy)
@@ -25,9 +25,12 @@
environment. If no command is specified, a login shell will be started in the
user's home directory inside the chroot.
.PP
-The command is a single argument which will be run in the user's default shell
-using its \[lq]\-c\[rq] option. As a result, shell code may be embedded in
-this argument.
+The command is one or more arguments which will be run in the user's default
+shell using its \[lq]\-c\[rq] option. As a result, shell code may be embedded
+in this argument. If multiple command options are used, they are concatenated
+together, separated by spaces. Users should be aware of the shell quoting
+issues this presents, and should use \fBschroot\fP if necessary, which does not
+have any quoting issues.
.PP
Unless the \fI-d\fP option is used to preserve the environment, the login shell
or command will run in the user's home directory inside the chroot, or / if the
@@ -196,12 +199,28 @@
.br
\f[CR]\fP
.br
+\f[CR]$ dchroot \-q \-c sid \-\- uname \-smr\fP
+.br
+\f[CR]Linux 2.6.16.17 ppc\fP
+.br
\f[CR]$ dchroot \-q \-c sid \-\- "uname \-smr"\fP
.br
\f[CR]Linux 2.6.16.17 ppc\fP
.br
\f[CR]\fP
.br
+\f[CR]$ dchroot -q -c sid "ls -1 / | tac | head -n 4"\fP
+.br
+\f[CR]var\fP
+.br
+\f[CR]usr\fP
+.br
+\f[CR]tmp\fP
+.br
+\f[CR]sys\fP
+.br
+\f[CR]\fP
+.br
\f[CR]$ dchroot \-c sid\fP
.br
\f[CR]I: [sid chroot] Running login shell: \[lq]/bin/bash\[rq]\fP
Index: dchroot/dchroot-session.cc
===================================================================
--- dchroot/dchroot-session.cc (revision 845)
+++ dchroot/dchroot-session.cc (working copy)
@@ -93,7 +93,7 @@
std::string& file,
string_list& command) const
{
- std::string programstring = command[0];
+ std::string programstring = sbuild::string_list_to_string(command, " ");
command.clear();
command.push_back(get_shell());
Index: NEWS
===================================================================
--- NEWS (revision 845)
+++ NEWS (working copy)
@@ -13,6 +13,10 @@
as the "plain" type, but additionally allows filesystem mounting
when setup scripts are enabled.
+ 2) A further dchroot compatibility issue has been corrected.
+ Multiple command options specified on the command line are
+ concatenated into a single command, separated by spaces.
+
* Major changes in 0.99.2:
1) A --debug option has been added to all programs. Its use is
Index: ChangeLog
===================================================================
--- ChangeLog (revision 845)
+++ ChangeLog (working copy)
@@ -1,3 +1,18 @@
+2006-07-13 Roger Leigh <[EMAIL PROTECTED]>
+
+ * debian/changelog: Close #378028.
+
+ * dchroot/dchroot.1.in: Document command option syntax.
+
+ * NEWS: Document dchroot command option syntax.
+
+ * dchroot/dchroot-session.cc
+ (get_user_command): Concatenate all command options into a single
+ command, separated by spaces.
+
+ * dchroot/dchroot-options.cc
+ (check_options): Allow any number of command options.
+
2006-07-12 Roger Leigh <[EMAIL PROTECTED]>
* All sources defining a custom_error<>::error_strings map define
Index: debian/changelog
===================================================================
--- debian/changelog (revision 845)
+++ debian/changelog (working copy)
@@ -5,6 +5,11 @@
declared outside the class, in addition to the friend declaration.
This fixes a compilation error with GCC 4.2 (Closes: #377433). Thanks
to Martin Michlmayr for reporting this.
+ * dchroot/dchroot-options.cc, dchroot/dchroot-session.cc: Allow any
+ number of command options, and concatenate all command options into a
+ single command, separated by spaces. This restores compatibility with
+ dchroot 0.13 and earlier (Closes: #378028). Thanks to David Liontooth
+ for reporting this.
* debian/schroot.docs: Add the contents of debian/docs.
* debian/docs: Remove.
* debian/rules:
@@ -15,7 +20,7 @@
* debian/dchroot-dsa.preinst: New file. Remove
/usr/share/doc/dchroot-dsa.
- -- Roger Leigh <[EMAIL PROTECTED]> Mon, 10 Jul 2006 09:09:05 +0100
+ -- Roger Leigh <[EMAIL PROTECTED]> Thu, 13 Jul 2006 13:22:20 +0100
schroot (0.99.2-1) unstable; urgency=low
pgpKE4G6apWCS.pgp
Description: PGP signature

