Changeset 8878 for src/Pugs/Embed

Show
Ignore:
Timestamp:
01/31/06 09:03:58 (3 years ago)
Author:
gaal
Message:

* change search order of external parrot, giving PARROT_PATH

precedence over PATH so that an old executable installed in the
system doesn't get in the way of a new one.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Embed/Parrot.hsc

    r8848 r8878  
    1717findExecutable' :: String -> IO (Maybe FilePath) 
    1818findExecutable' cmd = do 
    19     rv  <- findExecutable cmd 
    20     if isJust rv then return rv else do 
    21     cwd <- getCurrentDirectory 
    22     rv  <- findExecutableInDirectory cwd cmd 
    23     if isJust rv then return rv else do 
    2419    dir <- getEnv "PARROT_PATH" 
    25     if isNothing dir then return Nothing else do 
    26     rv  <- findExecutableInDirectory (fromJust dir) cmd 
    27     if isJust rv then return rv else do 
    28     return Nothing 
     20    if isJust dir then (do 
     21        rv  <- findExecutableInDirectory (fromJust dir) cmd 
     22        if isJust rv then return rv else findExecutable'') else do 
     23    findExecutable'' 
     24    where 
     25    findExecutable'' = do 
     26        rv  <- findExecutable cmd 
     27        if isJust rv then return rv else do 
     28        cwd <- getCurrentDirectory 
     29        rv  <- findExecutableInDirectory cwd cmd 
     30        if isJust rv then return rv else do 
     31        return Nothing 
    2932 
    3033findExecutableInDirectory :: FilePath -> FilePath -> IO (Maybe FilePath)