1
0
forked from GitHub/gf-rgl

Haskell/Shell build scripts handle multiple paths in GF_LIB_PATH (pick first)

Not implemented for Batch
This commit is contained in:
John J. Camilleri
2018-11-26 11:02:40 +01:00
parent ea56a524a1
commit 28bc19f09c
3 changed files with 4 additions and 3 deletions

View File

@@ -29,6 +29,7 @@ goto Loop
REM Try to determine install location
if "%dest%"=="" (
REM TODO Separate paths with search path separator ; and pick first one
set dest=%GF_LIB_PATH%
)
if "%dest%"=="" (

View File

@@ -9,7 +9,7 @@ import System.IO.Error (catchIOError)
import System.Exit (ExitCode(..),exitFailure)
import System.Environment (getArgs,lookupEnv)
import System.Process (rawSystem)
import System.FilePath ((</>)) -- ,takeFileName,addExtension,dropExtension)
import System.FilePath ((</>),splitSearchPath) -- ,takeFileName,addExtension,dropExtension)
import System.Directory (createDirectoryIfMissing,copyFile,getDirectoryContents,removeDirectoryRecursive,findFile)
#if __GLASGOW_HASKELL__>=800
import System.Directory (getModificationTime,setModificationTime)
@@ -119,7 +119,7 @@ mkInfo = do
-- Look for install location in a few different places
let mflag = getFlag destination_flag args
mbuilt <- catchIOError (readFile "../gf-core/DATA_DIR" >>= \d -> return (Just (d </> "lib"))) (\e -> return Nothing)
menvar <- lookupEnv "GF_LIB_PATH"
menvar <- lookupEnv "GF_LIB_PATH" >>= return . fmap (head . splitSearchPath)
let
inst_dir =
case catMaybes [mflag,menvar,mbuilt] of

View File

@@ -36,7 +36,7 @@ done
# Try to determine install location
if [ -z "$dest" ]; then
dest="$GF_LIB_PATH"
dest=$(echo "$GF_LIB_PATH" | sed 's/:.*$//')
fi
if [ -z "$dest" ] && [ -f "../gf-core/DATA_DIR" ]; then
dest=$(cat ../gf-core/DATA_DIR)