[PATCH] Use search path for scripts

Andrew STUBBS andrew.stubbs@st.com
Wed Nov 16 19:36:00 GMT 2005


Hi all,

This is my last new patch for a while, I promise!

This patch adjusts the source command such that it uses the search path 
(normally used to find sources) to find scripts.

This allows script files to be placed in a standard place and/or allow 
them to source one-another without knowing an absolute path. We use this 
mechanism to load all out target configuration routines from a toolchain 
installation.

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. This way users do not get a nasty 
surprise if they happen to have a script with a similar name to a 
standard one (perhaps sourced indirectly). They can use ./ if they 
really want a local file. If it were the other way around then the 
standard scripts would not work as intended and users would need to find 
an absolute path to use them by hand.

Andrew Stubbs
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: search-path.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20051116/51540ede/attachment.ksh>


More information about the Gdb-patches mailing list