From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31940 invoked by alias); 17 May 2013 16:44:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 31925 invoked by uid 89); 17 May 2013 16:44:50 -0000 X-Spam-SWARE-Status: No, score=-6.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 17 May 2013 16:44:49 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4HGifaV008912 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 17 May 2013 12:44:41 -0400 Received: from barimba (ovpn-113-158.phx2.redhat.com [10.3.113.158]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4HGicD4013120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 17 May 2013 12:44:39 -0400 From: Tom Tromey To: Christian Groessler Cc: Sergio Durigan Junior , gdb@sourceware.org, gdb-patches@sourceware.org Subject: Re: [patch]: testsuite: run bash instead of sh when using brace expansion References: <51936596.8010205@groessler.org> <5195E023.10203@groessler.org> Date: Fri, 17 May 2013 16:44:00 -0000 In-Reply-To: <5195E023.10203@groessler.org> (Christian Groessler's message of "Fri, 17 May 2013 09:45:39 +0200") Message-ID: <87a9ntr1xl.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-05/txt/msg00689.txt.bz2 >>>>> ">" == Christian Groessler 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