From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26015 invoked by alias); 17 Nov 2005 11:48:48 -0000 Received: (qmail 26007 invoked by uid 22791); 17 Nov 2005 11:48:45 -0000 Received: from lon-del-01.spheriq.net (HELO lon-del-01.spheriq.net) (195.46.50.97) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 17 Nov 2005 11:48:45 +0000 Received: from lon-out-01.spheriq.net ([195.46.50.129]) by lon-del-01.spheriq.net with ESMTP id jAHBmOmQ006349 for ; Thu, 17 Nov 2005 11:48:34 GMT Received: from lon-cus-01.spheriq.net (lon-cus-01.spheriq.net [195.46.50.37]) by lon-out-01.spheriq.net with ESMTP id jAHBmOnF030366 for ; Thu, 17 Nov 2005 11:48:24 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by lon-cus-01.spheriq.net with ESMTP id jAHBmNKg019278 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Thu, 17 Nov 2005 11:48:24 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6DE53DA42; Thu, 17 Nov 2005 11:48:23 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id 72F4A473E1; Thu, 17 Nov 2005 11:51:22 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 2A68975994; Thu, 17 Nov 2005 11:51:22 +0000 (UTC) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 196024730A; Thu, 17 Nov 2005 11:51:20 +0000 (GMT) Received: from [164.129.15.13] (terrorhawk.bri.st.com [164.129.15.13]) by mail1.bri.st.com (MOS 3.5.8-GR) with ESMTP id CGZ44296 (AUTH "andrew stubbs"); Thu, 17 Nov 2005 11:48:20 GMT Message-ID: <437C6D69.1030209@st.com> Date: Thu, 17 Nov 2005 12:41:00 -0000 From: Andrew STUBBS User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: Eli Zaretskii Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Use search path for scripts References: <437B6718.7070300@st.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-O-Spoofed: Not Scanned X-O-General-Status: No X-O-Spam1-Status: Not Scanned X-O-Spam2-Status: Not Scanned X-O-URL-Status: Not Scanned X-O-Virus1-Status: No X-O-Virus2-Status: Not Scanned X-O-Virus3-Status: No X-O-Virus4-Status: No X-O-Virus5-Status: Not Scanned X-O-Image-Status: Not Scanned X-O-Attach-Status: Not Scanned X-SpheriQ-Ver: 4.1.07 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-11/txt/msg00273.txt.bz2 Eli Zaretskii wrote: >>Date: Wed, 16 Nov 2005 17:06:32 +0000 >>From: Andrew STUBBS >> >>The search strategy employed is the one we have found most useful. If >>the path contains '/' then search relative to current directory first, >>otherwise search the path first. > > > How about trying in the current directory if the file name does not > have any slash characters? That sounds like the least surprising > behavior, and also keeps backward compatibility. We have a selection of scripts kept in the toolchain installation. These scripts are used to connect to and configure targets boards and simulators of many varieties. The scripts often reference one-another (sort of like an include statement) and in some cases are loaded lazily as required to keep the number of user-defined commands to a minimum. For these scripts to find each other they would either have to have absolute paths hard-coded in - not a possibility because we do not mandate any particular install location - or else add the directory to the search path and reference the files by base name. If the current directory was searched first then a users own scripts may accidentally (and silently) override the intended script causing a support headache. In short, the chosen strategy ensures that our product always works as our customers expect. In addition, this way round you can always specify which file you mean by adding './' whereas the other way round requires a lot more typing to say what you mean when it doesn't do what you expect. It would also require that the user search for the script themselves, and that isn't something your average customer is capable of (or so it seems). It certainly isn't something they want to do. I do see what you mean about backwards compatibility though. Andrew