| swln.8 |
swln - swpkg's package linker
swln -h
swln [ -v ] -V
swln [ -nIqv ] [ -S <dir> ] [ -T <dir> ] <package-name> [
<package-name> .. ]
swln -l [ -S <dir> ] [ -T <dir> ] [ -R <dir> ] <package-
name> [ <package-name> .. ]
swln -s [ -n ] [ -S <dir> ] [ -T <dir> ] [ <package-name> ..
]
swln -i [ -S <dir> ] [ -T <dir> ] [ <package-name> .. ]
The swln utility is a tool to manage links in a common
directory (the target directory) for software packages which
are all installed in separate directories (under the source
directory).
swln is used to create, check, and delete links which is
equivalent to installing, validating, and deleting packages
from the common directory.
The same operations can be performed to manage inter-package
dependencies. In this somewhat particular mode, the target
directory should be the package name where dependencies need
to be changed.
swln records installed packages in .swdb files (placed at
the top of the target directory) and logs all activity in
.swlog files (placed at the top of the source directory for
inter-package dependencies, and at the top of the target
directory otherwise). It is important to note that log
files are NOT automatically created by swln, hence that log-
ging only occurs if the log file already exist.
-h Display a brief help message.
-V Display the version information.
-n Don't do anything, only print what would be done.
-q Be quiet, only show errors.
-v Verbose output. By default (and unless the -n option
is used), swln is fairly quiet about what it does, and
will only report warnings and errors. The maximum ver-
bosity is obtained by specifying this option three
times, although twice is sufficient to get details of
what swln does.
-S <dir>
Specify an alternative source directory where to find
the package(s). The default is /usr/local/pkgs.
-T <dir>
Specify an alternative target directory where the links
should be created. It must exist. The default is
/usr/local.
If a package name is given for a valid package found
under the source directory, then swln operates in a
slightly altered mode suitable to handle inter-package
dependencies.
-R <dir>
This option allows overriding where links point to
which is useful when the source directory location is
not the one seen by systems using it.
-i This flag is used to produce reports on packages and
inter-package dependencies. When no package name is
specified, it will display the list of installed pack-
ages in the target directory. In this case, if the
target directory is actually a package (see above
description for option -T), then the list of
"installed" packages is really the list of dependencies
for the package. Finally, if a package name is given,
then swln will display the list of packages that have
dependencies on it.
-l Don't actually create links, instead, display the list
of links necessary for the package(s).
-s This flag is used for maintenance of target directories
and allows to look for stray links. A stray link is
defined as a link to a file under the source directory
that points either to a non existing file, or an exist-
ing file that should not be linked. If package names
are specified, then these are scanned and the target
directory checked based on the files found in the pack-
ages. If no package name is given, then the target
directory is entirely scanned.
Stray links are removed as they are found, and .swdb
files are also inspected for inconsistencies and
updated as necessary.
-I By default, swln will NOT replace any file in order to
create a link for a package. This flag allows to over-
ride this behaviour and should only be used when
migrating from a target directory containing software
packages directly installed in it. This will never
ever remove links which point to the source directory
(and are probably managed by swln). To do this, use
swln to delete the package to which the file belongs.
This option is not allowed when manipulating inter-
package dependencies. Although it is very strongly
recommended not to do so, it can be forced by specify-
ing it twice.
<package-name>
swln can work on one or more software packages at a
time. Each software package to work on needs to be
specified. Each package may be prefixed with "-" to
delete the package, "=" to validate the package instal-
lation, "+" to install a package with the -I -option
implied for that particular package, or "@" to update
an already installed package. If no prefix is given,
then the default action is to install the package.
For all operations, swln produces a similar output which
follows a fairly strict format in the hope of making it
easier to parse:
$ swln -n screen-3.9.4
-- scanning package screen-3.9.4...
.s /usr/local/bin/screen: will create [screen-3.9.4]
.s /usr/local/bin/screen-3.9.4: will create [screen-3.9.4]
.s /usr/local/man/man1/screen.1: will create [screen-3.9.4]
The first two characters are a condensed summary of the mes-
sage: the first indicates the current state of the target
directory, and the second the action taken by swln. The
different codes used are:
- miscellanneous message, notice.
. no such file or directory.
s symbolic link managed by swln (e.g. which is pointing
to a file under the source directory.
l other symbolic link.
d directory.
W warning message, condition.
E fatal error.
Following is the filename (under the target directory) con-
cerned, and then a human readable message in english.
Finally, between square brackets, one optionnaly finds the
software package to which this file belongs.
swln checks the source and target directories and each
software package top directory for the existence of the file
.swrc which can be used to customize the behaviour of swln
globally, and for each particular package respectively.
When used for inter-package dependencies, any .swrc file
found under the target directory (which is the package where
dependencies are being changed) is ignored.
This file understands a simple text based syntax. Lines
starting with # are ignored, and other lines accept the fol-
lowing directives:
link <regexp>
The regular expression is matched against filenames.
If a particular filename matches, the file is con-
sidered for linking in the target directory. The
filenames are relative to the top of the software pack-
age. Without a line like this, nothing is ever done.
It allows choosing which files (in packages) may be
made visible in the target directory. Some setups show
everything, others only directories containing
binaries. For a directory to be traversed, it must
match at least one "link" directive.
ignore <regexp>
The regular expression is matched against filenames.
If a particular filename matches, the file is then
ignored. The filenames are relative to the top of the
software package. Note that a match on a directory
will prevent it from being traversed, effectively
ignoring the entire subtree.
exclude <regexp>
As for the ignore directive, matching filenames are
ignored by swln. However, this applies to all opera-
tions including scanning, meaning that it should be
used carefully only when absolutely necessary. A good
example is when the source directory is located below a
target directory: in such situation, scanning the tar-
get directory would cause the source directory to be
scanned, something that isn't desirable.
dirlink <regexp>
The regular expression is matched against directory
names. If a particular directory matches, it is then
not traversed and will not be created in the target
directory. Instead a link will be created for it. The
names are relative to the top of the software package.
This directive should obviously only be used on for
directories specific to one package. There is rarely a
need for this, and the use of "dirlink" is discouraged.
Note that this is not available on Win32 platforms.
For .swrc files located in packages, the link, ignore and
dirlink directives may be prefixed by "usr" or "dep". These
modifiers allow restricting the directive to one particular
mode of operation:
usr This will cause the directive to only take effect when
working on a "user" target directory, and to be ignored
when handling inter-package dependencies.
dep This will cause the directive to only take effect when
handling inter-package dependencies, and to be ignored
when working on a "user" target directory.
Non prefixed directives found in packages always apply,
while non prefixed directives found in the source directory
are ignored when handling inter-package dependencies.
SWPKG_SOURCE
This may be used to override the compiled in default
source directory without specifying the -S option.
SWPKG_TARGET
This may be used to override the compiled in default
target directory without specifying the -T option.
Because it is hard to tell whether it will be possible to
remove a directory during package deletion, swln may
incorrectly report the impossibility to add a package when
combined with another package removal.
swchk(8), swinfo(8), swreport(8).
The latest official release of swpkg is available on the
web. The home page is http://web.taranis.org/swpkg/
Christophe Kalt <swpkg@taranis.org>
© 2002-2008 - Christophe Kalt