LGPL (GNU Lesser General Public License)    
reclinker is a recursive symlinking utility.




reclinker is a recursive symlinking utility. The project mirrors a hierarchy of files by means of symlinks.

The program has a linker, a deleter and a test mode. By default it's in
linker mode. It gets into deleter mode if it's invoked as recdeleter, and into
test mode if it's invoked as reclinktester. Linker/deleter/test mode may be
forced with the -l/-d/-t switches.

In linker mode it mirrors the directory tree under < from > to under < where >
and symlinks files there. The symlinks point to the basename of the file
processed, prefixed with < prefix >. If < prefix > is not given, it defaults
to the absolute pathname of < from > (ie., the symlink points to the
correct absolute filename).

In deleter mode it deletes non-broken symlinks (empty directories) of
the form < where >/foo, where < from >/foo is an existing file (directory).
(A dir is also considered empty if it gets empty during the deletion

In test mode it tests whether symlinks/dirs under < where > corresponding
to files/dirs under < from > exist, and whether are they created properly.

If extra arguments are given, then they will be treated as files named
relatively from < from >, and they will be proceeded individually
(no mass action is taken). If "-" is among these extra arguments,
then individual file names are also read from stdin; if "0-" is among
them, individual file names are also read from stdin, being separated
by ''.

Here are some key features of "reclinker":

written in pure C (no dependencies, fast)
free of forced, confusing package management terminology (like stow dir, target dir, package)
supports both absolut and relative linking
supports linking into existing hierarchies, handles properly already existing directory symlinks in the target hierarchy (like /usr/man -> share/man)
supports access control (set ownership/mode of created links/directories, filter processed files based on ownership/mode requirements)
license is LGPL, not GPL (some may think it's a feature)

It also has a feature which makes it similar to cpio passthrough mode: reclinker can take a list of files on stdin, and link only those files which occur in the list.

reclinker was written to be the part of a more comprehensive symlinky package management scheme, IFS. IFS is not ready but you can just start using reclinker immediately.

Options common for all modes:

-h print this message and exit
-U < user > skip file under < from > if it's not owned by < user >
-G < group > skip file under < from > if it doesn't belong to < group >
-v/-q increase/decrease verbosity level
(currently 0, 1, 2 are in use, default is 1)

Options in linker mode are:

-r produce relative symlinks
-f overwrite existing files
-m < mode > create new directories with mode < mode > ( &'d with umask!)
-o force < mode > given by -m for all processed directories
(if -m is not used, the mode of the actually processed
dir is forced)
-u < user > newly created dirs/symlinks shall be owned by < user >
-g < group > newly created dirs/symlinks shall belong to < group >
-D only directories are proceeded
-p < prefix > prepend < prefix > to link targets

Options in deleter mode are:

-f delete corresponding file even it's not a symlink
-m < mode > deletes < where >/foo only if < from >/foo is of mode < mode >
-o only broken symlinks are deleted
-u < user > deletes < where >/foo only if it belongs to < user >
-g < group > deletes < where >/foo only if it belongs to < group >
-D don't delete directories

Options in test mode are:

-r test symlinks as if they were created using -r in linker mode
-m < mode > skip foo if < from >/foo isn't of mode < mode >
-u < user > skip foo if < where >/foo is not owned by < user >
-g < group > skip foo if < where >/foo doesn't belong to < group >
-p < prefix > test links assuming they were created using "-p < prefix >"

Return values: 0 - success; 1 - fatal error; 2 - some act failed but
just kept on doing; 3 - arguments imply nothing happens (eg., bad
options used)
Last updated on May 24th, 2007

0 User reviews so far.