Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
curry-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
curry
curry-tools
Commits
23540461
Commit
23540461
authored
Nov 16, 2018
by
Michael Hanus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CPM updated
parent
4c36b254
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
9 deletions
+22
-9
cpm/docs/manual.tex
cpm/docs/manual.tex
+2
-2
cpm/src/CPM/Config.curry
cpm/src/CPM/Config.curry
+16
-4
cpm/src/CPM/Main.curry
cpm/src/CPM/Main.curry
+1
-1
cpm/src/CPM/PackageCache/Runtime.curry
cpm/src/CPM/PackageCache/Runtime.curry
+3
-2
No files found.
cpm/docs/manual.tex
View file @
23540461
...
...
@@ -309,7 +309,7 @@ one can use the command
cypm install <package>
\end{lstlisting}
This command checks out the package in some internal directory
(default:
\code
{
\$
HOME/.cpm/app
_
packages
}
, see
(default:
\code
{
\$
HOME/.cpm/app
s
_$
Curry system
$
}
, see
Section~
\ref
{
sec:config
}
)
and installs the binary of the application provided by the package
in
\code
{
\$
HOME/.cpm/bin
}
(see also Section~
\ref
{
sec:checkout
}
).
...
...
@@ -685,7 +685,7 @@ Default value: \code{\$HOME/.cpm/bin}
\item
[\fbox{\code{APP_PACKAGE_PATH}}]
The path to the package cache where packages are checked out if only
their binaries are installed (see Section~
\ref
{
sec:installapp
}
).
Default value:
\code
{
\$
HOME/.cpm/app
_
packages
}
.
Default value:
\code
{
\$
HOME/.cpm/app
s
_$
Curry system
$
}
.
\item
[\fbox{\code{HOME_PACKAGE_PATH}}]
The path to the meta-package which is used if you are outside another
...
...
cpm/src/CPM/Config.curry
View file @
23540461
...
...
@@ -65,7 +65,7 @@ defaultConfig = Config
{ packageInstallDir = "$HOME/.cpm/packages"
, binInstallDir = "$HOME/.cpm/bin"
, repositoryDir = "$HOME/.cpm/index"
, appPackageDir = "
$HOME/.cpm/app_packages"
, appPackageDir = "
"
, packageIndexURL = packageIndexDefaultURL
, homePackageDir = ""
, curryExec = Dist.installDir </> "bin" </> Dist.curryCompiler
...
...
@@ -113,6 +113,17 @@ setCompilerExecutable cfg = do
maybe (error $ "Executable '" ++ exec ++ "' not found in path!")
(\absexec -> return cfg { curryExec = absexec })
--- Sets the `appPackageDir` depending on the compiler version.
setAppPackageDir :: Config -> IO Config
setAppPackageDir cfg
| null (appPackageDir cfg)
= do homedir <- getHomeDirectory
let cpmdir = homedir </> ".cpm"
(cname,cmaj,cmin) = compilerVersion cfg
cmpname = cname ++ "_" ++ show cmaj ++ "." ++ show cmin
return cfg { appPackageDir = cpmdir </> "apps_" ++ cmpname }
| otherwise = return cfg
--- Sets the `homePackageDir` depending on the compiler version.
setHomePackageDir :: Config -> IO Config
setHomePackageDir cfg
...
...
@@ -190,10 +201,11 @@ readConfigurationWith defsettings = do
case mergedSettings of
Left e -> return $ Left e
Right s0 -> do s1 <- replaceHome s0
createDirectories s1
s2 <- setCompilerVersion s1
s3 <- setHomePackageDir s2
return $ Right s3
s3 <- setAppPackageDir s2
s4 <- setHomePackageDir s3
createDirectories s4
return $ Right s4
replaceHome :: Config -> IO Config
replaceHome cfg = do
...
...
cpm/src/CPM/Main.curry
View file @
23540461
...
...
@@ -56,7 +56,7 @@ cpmBanner :: String
cpmBanner = unlines [bannerLine,bannerText,bannerLine]
where
bannerText =
"Curry Package Manager <curry-language.org/tools/cpm> (version of
05/10
/2018)"
"Curry Package Manager <curry-language.org/tools/cpm> (version of
15/11
/2018)"
bannerLine = take (length bannerText) (repeat '-')
main :: IO ()
...
...
cpm/src/CPM/PackageCache/Runtime.curry
View file @
23540461
...
...
@@ -10,7 +10,7 @@ module CPM.PackageCache.Runtime
, writePackageConfig
) where
import FilePath ( (</>), (<.>) )
import FilePath ( (</>), (<.>)
, takeDirectory
)
import FileGoodies ( baseName )
import Directory ( createDirectoryIfMissing, copyFile, getDirectoryContents
, getAbsolutePath, doesDirectoryExist, doesFileExist )
...
...
@@ -70,7 +70,7 @@ ensureCacheDirectory :: String -> IO String
ensureCacheDirectory dir = do
createDirectoryIfMissing True packagesDir
return packagesDir
where packagesDir = dir </> ".cpm" </> "packages"
where packagesDir = dir </> ".cpm" </> "packages"
--- Writes the package configuration module (if specified) into the
...
...
@@ -91,6 +91,7 @@ writePackageConfig cfg pkgdir pkg loadpath =
writeConfigFile configmod binname = do
let configfile = pkgdir </> "src" </> foldr1 (</>) (split (=='.') configmod)
<.> ".curry"
createDirectoryIfMissing True (takeDirectory configfile)
abspkgdir <- getAbsolutePath pkgdir
writeFile configfile $ unlines $
[ "module " ++ configmod ++ " where"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment