From: Tom Tromey <tromey@redhat.com>
To: Christian Groessler <chris@groessler.org>
Cc: Sergio Durigan Junior <sergiodj@redhat.com>,
gdb@sourceware.org, gdb-patches@sourceware.org
Subject: Re: [patch]: testsuite: run bash instead of sh when using brace expansion
Date: Fri, 17 May 2013 16:44:00 -0000 [thread overview]
Message-ID: <87a9ntr1xl.fsf@fleche.redhat.com> (raw)
In-Reply-To: <5195E023.10203@groessler.org> (Christian Groessler's message of "Fri, 17 May 2013 09:45:39 +0200")
>>>>> ">" == Christian Groessler <chris@groessler.org> writes:
>> How about the following patch? My tcl fu is not that strong, so I
>> explicitly wrote out the expanded strings instead of computing them.
You can do something like:
set dirs {}
foreach l {/ldir ""} {
foreach r {/rdir ""} {
... more foreaches here ...
lappend dirs [join [list $l $r $...]]
}
}
>> The shell command line could get quite long with this change,
>> depending how deep
>> the build directory is located in the hierarchy. I could invoke the
>> shell for each path separately, but
>> this would be slower. Any opinions?
If the result is too long we could batch it.
But I would not worry about it for now.
>> +proc reverse {lst} {
We have 'lreverse' in new Tcl, plus a compatibility proc in future.exp.
>> +proc pathexpand {prefix dirlst suffix} {
>> + set retlst {}
>> + for {set i 0} {$i < [llength $dirlst]} {incr i} {
>> + lappend retlst "$prefix[lindex $dirlst $i]$suffix"
>> + }
>> + return $retlst
foreach is more idiomatic.
Tom
next prev parent reply other threads:[~2013-05-17 16:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <51936596.8010205@groessler.org>
[not found] ` <m3hai3kes8.fsf@redhat.com>
2013-05-17 7:45 ` Christian Groessler
2013-05-17 8:13 ` Joel Brobecker
2013-05-17 16:44 ` Tom Tromey [this message]
2013-05-17 22:57 ` Christian Groessler
2013-05-20 15:16 ` Tom Tromey
2013-05-21 7:27 ` Christian Groessler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a9ntr1xl.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=chris@groessler.org \
--cc=gdb-patches@sourceware.org \
--cc=gdb@sourceware.org \
--cc=sergiodj@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox