Willie Wonka <floydstestemail@yahoo.com> writes:
> Owen Heisler wrote:
>> As a workarround, you can set the SU_NO_SHELL_ARGS environment variable
>> before calling dchroot, or execute
>> dchroot -- -c "command"
>> instead of
>> dchroot -- command
>> ___
>>
>> And you say write a script, so I put the following in ~/go
>> ___
>> #!/bin/bash
>> dchroot -d -c unstable ls
>> ___
>> but I get the same error when I run "./go".
Hi, I'm the schroot/dchroot maintainer. I missed the initial
question, but I'd just like to note that
- the dchroot behaviour had an unintentional backward-incompatible
change in the options parsing and command execution. This has since
been corrected; it's currently waiting in NEW and should enter sid
in a week or so. In the meantime, it's available from
https://alioth.debian.org/project/shownotes.php?release_id=816
https://alioth.debian.org/download.php/1654/schroot-0.99.1.tar.bz2
- schroot allows any number of command-line options, e.g.
$ schroot -c chroot -- foo --opt1 --opt2 bar baz
- dchroot allows a single command, but invokes it automatically via
"sh -c":
$ dchroot -c chroot "foo --opt1 --opt2 bar baz"
The schroot syntax (which dchroot in sid is transiently using) is
rather more flexible, but if you want the dchroot semantics just
requires '-- sh -c "command"' instead of 'command'.
> Isn't the syntax in that original command, you posted from the bug report
> actually telling the command dchroot to *ignore* any following 'options', by
> using the ' -- ' syntax, just after the command...IOW
>
> Doesn't this;
>> dchroot -- -c "command"
> mean: dchroot, ignore options that follow, then pass to it the -c
> option (which it may ignore?), then "command".?
This would mean run the "-c" program with "command" as the first
option (!). Probably not quite what is desired.
> I only ask b/c, I've learned (from lurking about usenet) that this
> is one trick that's used to remove filenames that begin with a '-'
> (hyphen), when using the 'rm' command.
Yes. It's used here so that dchroot/schroot can distinguish between
options for themselves and options for the program you want to run.
For example,
schroot ls -l
and
schroot -- ls -l
are different. With the former, schroot gets the "-l" option, but
with the latter ls gets it.
BTW, any dchroot/schroot questions are welcome on the
buildd-tools-devel mailing list.
Regards,
Roger
--
Roger Leigh
Printing on GNU/Linux? http://gutenprint.sourceforge.net/
Debian GNU/Linux http://www.debian.org/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
Attachment:
pgp6keohc8XIJ.pgp
Description: PGP signature