Subversion Repositories DevTools

Rev

Rev 255 | Rev 263 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 255 Rev 261
Line 225... Line 225...
225
#
225
#
226
# Inputs          : prog            - Program to locate
226
# Inputs          : prog            - Program to locate
227
#                   args            - Options
227
#                   args            - Options
228
#                                     --All : Search all of PATH
228
#                                     --All : Search all of PATH
229
#                                             Used by build tools
229
#                                             Used by build tools
-
 
230
#                                     --Path= User provided pathlist
230
#
231
#
231
# Returns         : Path name of the file
232
# Returns         : Path name of the file
232
#
233
#
233
sub LocateProgInPath
234
sub LocateProgInPath
234
{
235
{
235
    my ($prog, @args ) = @_;
236
    my ($prog, @args ) = @_;
236
    my $all = 0;
237
    my $all = 0;
237
    my $stop_dir;
238
    my $stop_dir;
-
 
239
    my $upath = $ENV{PATH};
238
 
240
 
239
    #
241
    #
240
    #   Extract arguments
242
    #   Extract arguments
241
    #
243
    #
242
    foreach ( @args )
244
    foreach ( @args )
243
    {
245
    {
-
 
246
        #
-
 
247
        #   Search in all paths: Don't limit ourselves to JATS
-
 
248
        #
244
        if ( m/^--All/ ) {
249
        if ( m/^--All/ ) {
245
            $all = 1;
250
            $all = 1;
246
        }
251
        }
-
 
252
 
-
 
253
        #
-
 
254
        #   User provided pathlist
-
 
255
        #   Allow for an empty list - which will use the default path
-
 
256
        #
-
 
257
        if ( m/^--Path=(.+)/ ) {
-
 
258
            if ( $1 ) {
-
 
259
                $upath = $1;
-
 
260
                $all = 1;
-
 
261
            }
-
 
262
        }
247
    }
263
    }
248
 
264
 
249
    #
265
    #
250
    #   Stop at the JATS BIN directory, unless requested otherwise
266
    #   Stop at the JATS BIN directory, unless requested otherwise
251
    #
267
    #
Line 270... Line 286...
270
 
286
 
271
    #
287
    #
272
    #   Scan all toolset directories
288
    #   Scan all toolset directories
273
    #   for the program
289
    #   for the program
274
    #
290
    #
275
    for my $dir ( split ( $ScmPathSep, $ENV{PATH} ) )
291
    for my $dir ( split ( $ScmPathSep, $upath ) )
276
    {
292
    {
277
        for my $ext ( @elist )
293
        for my $ext ( @elist )
278
        {
294
        {
279
            my $tool = "$dir/$prog$ext";
295
            my $tool = "$dir$ScmDirSep$prog$ext";
280
            Debug2( "LocateProgInPath: Look for: $tool" );
296
            Debug2( "LocateProgInPath: Look for: $tool" );
281
 
297
 
282
            return $tool if ( -f $tool );
298
            return $tool if ( -f $tool );
283
        }
299
        }
284
 
300