Commit 2bbd4f92 authored by Michael Hanus's avatar Michael Hanus
Browse files

Hints for package administration

parents
Hints for Package Administraion
===============================
This package contains hints for administrating packages
with the Curry Package Manager. The use of the package manager
is described in the
[manual of CPM](http://www-ps.informatik.uni-kiel.de/currywiki/_media/tools/cpm/manual.pdf)
and the [wiki page](http://www-ps.informatik.uni-kiel.de/currywiki/tools/cpm)
contains a short introduction into its use.
Hence, the infos given here are for advanced use of CPM
and manual uploading and updating of packages.
Using CPM with different Curry systems
--------------------------------------
An application generated with CPM usually depends on the Curry
system and its base libraries (e.g., CurryDoc, CurryPP).
In order to generate applications for different Curry systems
in parallel, one has to switch the CPM configuration and
internal directories wen using one of the Curry systems.
This can easily be done with the shell script `cpm-switch`
stored in the directory `scripts` of this package.
In order to switch to some Curry system, e.g., `mycurry`,
create a file `.cpmrc_mycurry` in your home directory
which defines the binary of your Curry system as `curry_bin`.
For instance, it must contain at least the line
curry_bin=/opt/.../bin/curry
Then you can configure your local CPM files to use this
system by the command
cpm-switch mycurry
This script puts some symbolic links (`.cpm/bin`, `.cpm/app_packages`)
and copies the containt of `.cpmrc_mycurry` into `.cpmrc`.
By defining a different `.cpmrc_` file, you can switch between
different Curry systems.
Uploading and updating packages in the global repository
--------------------------------------------------------
The package `cpm-manage` contains a simple tool to support
the uploading and updating packages. Note the this
requires write access to the
[global package repository](https://git.ps.informatik.uni-kiel.de/curry-packages/cpm-index)!
To install the tool, run
> cypm install cpm-manage
Then you can use the following commands:
Uploading a new package:
------------------------
First, put the package into some git repo and set the source
specification in `package.json` to the URI of this repo.
Then go into the package (where the file `package.json` is stored)
and run
> cpm-manage add
This command tags the repo with the version number specified
in `package.json`, tests the package with `cypm test` and,
if everything is successful, updates your local copy of the global index.
Then it shows you a shell command to be executed to really
update the global index.
The same command could be used to upload a new version of some package,
but please read the following paragraph.
Updating a package:
-------------------
Due to the missing database infrastructure of the current CPM
implementation, one should avoid to create too many versions
of a package (since this slows down the use of CPM).
Hopefully, this will change in the near future.
For the time being, you one update an existing package
with the same version number. This could be done by
storing the updated package in its git repo and running the command
> cpm-manage update
This command re-tags the repo with the version number specified
in `package.json`, tests the package with `cypm test` and,
if everything is successful, updates your local copy of the global index.
If something was changed also in `package.json`, the
global index must also be updated, i.e., one has to go into
`~/.cpm/index` and push the updates to the global index.
Testing all packages:
---------------------
One can checkout and test all packages (compatible to your current
Curry system) by the command
> cpm-manage testall
Of course, this needs some time...
Showing a dependency graph of all packages:
-------------------------------------------
This can be done with the command
> cpm-manage showgraph
#!/bin/sh
# change my local configuration files for CPM so that a Curry system
# specified in .cpmrc_<curry-system> is used.
if [ $# -eq 0 ] ; then
CURRYSYSTEM=`expr $0 : '.*cpm-switch-\(.*\)'`
if [ -z "$CURRYSYSTEM" ] ; then
echo "Usage: cpm-switch <curry-system>"
echo "where <curry-system> is pakcs, pakcs2,..."
exit 1
fi
elif [ $# -eq 1 ] ; then
CURRYSYSTEM=$1
else
echo "Usage: cpm-switch <curry-system>"
echo "where <curry-system> is pakcs, pakcs2,..."
exit 1
fi
echo "Switching CPM config dirs to Curry system '$CURRYSYSTEM'..."
# set ~/.cpmrc:
if [ ! -f $HOME/.cpmrc_$CURRYSYSTEM ] ; then
echo "File '$HOME/.cpmrc_$CURRYSYSTEM' does not exist!"
echo "Please create this file (e.g., by copying and modifying '$HOME/.cpmrc'"
echo "and setting the definition of 'curry_bin' in this file)"
exit 1
fi
rm -f $HOME/.cpmrc && cp -p $HOME/.cpmrc_$CURRYSYSTEM $HOME/.cpmrc
# set cpm bin dir:
rm -f $HOME/.cpm/bin
mkdir -p $HOME/.cpm/bin_$CURRYSYSTEM
ln -s $HOME/.cpm/bin_$CURRYSYSTEM $HOME/.cpm/bin
# set cpm app_packages dir:
rm -f $HOME/.cpm/app_packages
mkdir -p $HOME/.cpm/app_packages_$CURRYSYSTEM
ln -s $HOME/.cpm/app_packages_$CURRYSYSTEM $HOME/.cpm/app_packages
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