NAME

pkg_export ­ A personal package management tool

SYNOPSIS

pkg_export [ -x/u/c/i/h ] [ -f ] [ package path ]

DESCRIPTION

The pkg_export(1) command allows one to manage directory based packages.

A package is exported by creating symbolic links to some of its files in shared directories. Which files should be exported and where is specified by the EXPORTS and PKGROOT files, at the root of the package path, which is the current directory when omitted. Optional CLIENTS and PKGPATH files improve security by allowing one to check who requires this package, and where it should be installed. Export and unexport actions are logged to the EXPORTLOG file, along with the host name and date.

Compared to more powerful package managers, which handle everything from compilation of packages from source to maintenance of a package database, pkg_export(1) is much simpler, and is essentially intended for local maintenance of manually compiled packages. As such the support for package distribu­ tion is quite limited.

On the other hand, it is strong at maintaining multiple versions of the same software. All versions are installed in different directories (just set a different install prefix when compiling). To change the globally available version you just have to unexport the old version, and export the new version. Software that relies on the old version directly (not through the global links) will still work, and if you see some anomaly with the new version, you can go back to the old one at any time.

The logging mechanism provides a basic support for package management on multiple hosts in a net­ work.

OPTIONS

The following command­line options are recognized by pkg_export(1).

­x, ­export

Create symbolic links according to the EXPORTS file. This is the default behaviour when no option is given.

­u, ­unexport

Remove the symbolic links created by ­export. Before doing so, checks whether some of these links point to something else, and whether the package has some clients. In the last case, confir­ mation is required.

­c, ­check

Check that the package is correctly exported. This includes verifying that all the links are point­ ing to somewhere inside the package path.

­i, ­info Print out the contents of the various control files EXPORTS, CLIENTS, PKGROOT and PKG­
PATH,
and the log file EXPORTLOG.

­h, ­help
Print a short explanation of the different commands.

­f, ­force
Disable warnings. Combined with
­export, force deletion of files in the way. Combined with
­unexport,
do not check dependencies.

FILES

The following files are used by pkg_export(1).

EXPORTS

A list of the exported files, with an optional export path. Files are given one per line, with option­ ally an arrow sign ( ­> ) followed by the link to be created. If no link path is given, the file path itself is used. Original paths are relative to the package path, and destination paths are relative to the package root, /usr/local by default. Lines starting by ; are ignored as comments.

For instance the following contents for EXPORTS,

bin/mycmd
man/man1/mycmd.1
share ­> share/mypkg

mean that package path /bin/mycmd will be linked to /usr/local/bin/mycmd and similarly for mycmd.1; and package path /share will be linked to /usr/local/share/mypkg.

EXPORTLOG

Export actions (when they create links) and unexport actions (when there are no links left) are logged to this file, following the format:
host: {exported|unexported} on date
Only the last log record is kept for each different host.

PKGROOT

An optional file indicating the root to use for relative paths in EXPORTS. The default root is /usr/local.

CLIENTS

The absolute paths of the packages requiring this one. It is checked before unexporting a pack­ age. New clients should be added by hand, which is very primitive, but should be enough for personal use.

PKGPATH

An optional absolute path, where this package should be installed. This is useful when giving somebody a package containing some fixed paths.

EXIT VALUES

The following exit values are returned:

0

2

Operation completed successfully. For ­check, package is correctly exported.

An error occured. For ­check, package is not correctly exported.

BUGS

pkg_export(1) is a Bourne­shell script. As such it is rather portable, but quite prone to bugs.

One limitation is that file names in EXPORTS had to be reduced to those that would not confuse the shell. Accepted file names are
[­0­9A­Za­z#%~@+:,./_]
*
Incorrect lines will be printed out, and no action will be taken if
EXPORTS contains any of these.

For the same reason you should be careful about checking the contents of EXPORTS if you got it from somebody. For efficiency, pkg_export is actually interpreting its contents after substitution, making it a possible Trojan horse.

AUTHOR

Jacques Garrigue <garrigue@kurims.kyoto­u.ac.jp>

URL

http://wwwfun.kurims.kyoto­u.ac.jp/~garrigue/pkg_export/