Commit 7b9693a4 authored by Michael Hanus's avatar Michael Hanus
Browse files

Uses packages execpath and frontend-exec

parent 6540c196
abstract-curry https://git.ps.informatik.uni-kiel.de/curry-packages/abstract-curry.git v2.0.0
boxes https://git.ps.informatik.uni-kiel.de/curry-packages/boxes.git v2.0.0
opt-parse https://git.ps.informatik.uni-kiel.de/curry-packages/opt-parse.git v0.0.3
det-parse https://git.ps.informatik.uni-kiel.de/curry-packages/det-parse.git v0.0.1
json https://git.ps.informatik.uni-kiel.de/curry-packages/json.git v2.0.0
cass-analysis https://git.ps.informatik.uni-kiel.de/curry-packages/cass-analysis.git v2.0.0
cass https://git.ps.informatik.uni-kiel.de/curry-packages/cass.git v2.0.0
abstract-curry https://git.ps.informatik.uni-kiel.de/curry-packages/abstract-curry.git v2.0.0
cdbi https://git.ps.informatik.uni-kiel.de/curry-packages/cdbi.git v2.0.0
csv https://git.ps.informatik.uni-kiel.de/curry-packages/csv.git v1.0.0
det-parse https://git.ps.informatik.uni-kiel.de/curry-packages/det-parse.git v0.0.1
execpath https://git.ps.informatik.uni-kiel.de/curry-packages/execpath.git v0.0.1
flatcurry https://git.ps.informatik.uni-kiel.de/curry-packages/flatcurry.git v2.0.0
frontend-exec https://git.ps.informatik.uni-kiel.de/curry-packages/frontend-exec.git v0.0.1
json https://git.ps.informatik.uni-kiel.de/curry-packages/json.git v2.0.0
opt-parse https://git.ps.informatik.uni-kiel.de/curry-packages/opt-parse.git v0.0.3
propertyfile https://git.ps.informatik.uni-kiel.de/curry-packages/propertyfile.git v0.0.1
wl-pprint https://git.ps.informatik.uni-kiel.de/curry-packages/wl-pprint.git v0.0.1
csv https://git.ps.informatik.uni-kiel.de/curry-packages/csv.git v1.0.0
cdbi https://git.ps.informatik.uni-kiel.de/curry-packages/cdbi.git v2.0.0
xml https://git.ps.informatik.uni-kiel.de/curry-packages/xml.git v2.0.0
......@@ -12,6 +12,8 @@
"abstract-curry": ">= 2.0.0",
"cdbi" : ">= 2.0.0",
"det-parse" : ">= 0.0.1",
"execpath" : ">= 0.0.1",
"frontend-exec" : ">= 0.0.1",
"opt-parse" : ">= 0.0.3",
"boxes" : ">= 2.0.0",
"json" : ">= 2.0.0",
......
......@@ -12,18 +12,20 @@ module CPM.AbstractCurry
, applyModuleRenames
) where
import Distribution ( FrontendTarget (..), FrontendParams (..), defaultParams
, callFrontendWithParams, setQuiet, setFullPath
, sysLibPath, inCurrySubdir, modNameToPath
import Distribution ( sysLibPath, inCurrySubdir, modNameToPath
, inCurrySubdirModule, lookupModuleSource )
import List ( intercalate, nub )
import FilePath ( (</>), (<.>), takeFileName, replaceExtension )
import List ( intercalate, nub )
import FilePath ( (</>), (<.>), takeFileName, replaceExtension )
import System
import AbstractCurry.Files ( readAbstractCurryFile, writeAbstractCurryFile )
import AbstractCurry.Pretty ( showCProg )
import AbstractCurry.Select ( imports )
import AbstractCurry.Transform
import AbstractCurry.Types
import System
import System.FrontendExec ( FrontendTarget (..), FrontendParams (..)
, defaultParams, callFrontendWithParams
, setQuiet, setFullPath )
import CPM.ErrorLogger
import qualified CPM.PackageCache.Runtime as RuntimeCache
......
......@@ -23,8 +23,10 @@ import Maybe ( mapMaybe )
import PropertyFile ( readPropertyFile )
import Read ( readInt )
import System.Path ( getFileInPath )
import CPM.ErrorLogger
import CPM.FileUtil ( ifFileExists, getFileInPath )
import CPM.FileUtil ( ifFileExists )
import CPM.Helpers ( strip )
--- The default location of the central package index.
......
......@@ -12,7 +12,6 @@ module CPM.FileUtil
, linkTarget
, copyDirectoryFollowingSymlinks
, quote
, fileInPath, getFileInPath
, tempDir
, inTempDir
, inDirectory
......@@ -81,27 +80,6 @@ linkTarget link = do
quote :: String -> String
quote s = "\"" ++ s ++ "\""
--- Checks whether a file exists in one of the directories on the PATH.
fileInPath :: String -> IO Bool
fileInPath file = do
path <- getEnviron "PATH"
let dirs = splitOn ":" path
(liftIO (any id)) $ mapIO (doesFileExist . (</> file)) dirs
--- Checks whether a file exists in one of the directories on the PATH
--- and returns absolute path, otherwise returns `Nothing`.
getFileInPath :: String -> IO (Maybe String)
getFileInPath file = do
path <- getEnviron "PATH"
checkPath (splitOn ":" path)
where
checkPath [] = return Nothing
checkPath (dir:dirs) = do
let dirfile = dir </> file
ifFileExists dirfile
(getAbsolutePath dirfile >>= return . Just)
(checkPath dirs)
--- Gets CPM's temporary directory.
tempDir :: IO String
tempDir = do
......
......@@ -24,10 +24,11 @@ import System ( getArgs, getEnviron, setEnviron, unsetEnviron, exitWith
import Boxes ( table, render )
import OptParse
import System.Path ( fileInPath )
import Text.CSV ( showCSV )
import CPM.ErrorLogger
import CPM.FileUtil ( fileInPath, joinSearchPath, safeReadFile, whenFileExists
import CPM.FileUtil ( joinSearchPath, safeReadFile, whenFileExists
, ifFileExists, inDirectory, inTempDir, recreateDirectory
, removeDirectoryComplete, copyDirectory, quote, tempDir )
import CPM.Config ( Config (..)
......@@ -57,7 +58,7 @@ cpmBanner :: String
cpmBanner = unlines [bannerLine,bannerText,bannerLine]
where
bannerText =
"Curry Package Manager <curry-language.org/tools/cpm> (version of 18/11/2018)"
"Curry Package Manager <curry-language.org/tools/cpm> (version of 20/11/2018)"
bannerLine = take (length bannerText) (repeat '-')
main :: IO ()
......@@ -1526,11 +1527,11 @@ uploadCmd opts cfg =
removeInstalledPkg pkgid >>
uploadPackageSpec (instdir </> pkgid </> "package.json") |>
-- add package to local copy of repository:
addPackageToRepo pkgrepodir (instdir </> pkgid) pkg pkgid >>
addPackageToRepo pkgrepodir (instdir </> pkgid) pkg >>
removeDirectoryComplete instdir >>
log Info ("Package '" ++ pkgid ++ "' uploaded")
where
addPackageToRepo pkgrepodir pkgdir pkg pkgid = do
addPackageToRepo pkgrepodir pkgdir pkg = do
exrepodir <- doesDirectoryExist pkgrepodir
infoMessage $ "Create directory: " ++ pkgrepodir
createDirectoryIfMissing True pkgrepodir
......
......@@ -16,10 +16,11 @@ import ReadShowTerm
import Database.CDBI.ER
import Database.CDBI.Connection
import System.Path ( fileInPath )
import CPM.Config ( Config, readConfigurationWith, repositoryDir )
import CPM.ErrorLogger
import CPM.FileUtil ( fileInPath, whenFileExists )
import CPM.FileUtil ( whenFileExists )
import CPM.Repository.RepositoryDB
import CPM.Package
import CPM.Repository
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment