[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: My views on release management



James R. Van Zandt wrote:
> Brandon Mitchell <bmitch@atdot.org> writes:
> >  I'd also suggest flattening the symlinks at the beginning of
> >the freeze for the mirrors to catch up earlier rather than later.
> 
> I second this suggestion.
> 
> Further, I ask that the flattening not be done all at once.  Instead,
> stage it by section: [...]

Actually I started on a script that can do this better: it unsymlinks
up to a particular number of megabytes when it is run.  It has a bug
though.  I'll attach its manpage.

An implementation is becoming more likely now, since Jason wrote some
nicely evil symlink handling code for dsync that I can use.

Richard Braakman
.TH UNSYMLINK 1 "1998 November 30" "Debian GNU/Linux"
.SH NAME
unsymlink \- replace symbolic links with real files
.SH SYNOPSIS
.B unsymlink
[options ...]
.I pathnames...
.SH DESCRIPTION
.B unsymlink
scans the pathnames passed to it for symbolic links (recursing into directory
trees as needed), and selectively converts them to real files.  In the
simplest case,
.RB ` unsymlink
.IR filename '
will replace a single symbolic link with its target.

By default, it does this by replacing the symbolic link with a hard link,
if this is possible, and making a copy of the link's target otherwise.
See the
.B --copy
option for details.

.B unsymlink
distinguishes between two kinds of symbolic links:
.I internal
links, which have their targets among (or inside) the pathnames given on the
command line, and
.I external
links, which have their targets elsewhere.
.B unsymlink
always ignores dangling links and symbolic links that point to directories.

By default,
.B unsymlink
operates only on external links.  The
.B --all
and
.B --leave
options can be used to modify this.
.SH OPTIONS
.TP
.BI "\-a, --all"
Unsymlink internal links as well.
.B --leave
still overrides
.BR --all .
.TP
.BI "\-c " action ", --copy=" action
where
.I action
is one of
.BR default ", " always ", or " never .
This option controls whether
.B unsymlink
will replace symbolic links with hard links, or with copies of their
targets.  Since hard links cannot span filesystems, it is not always
possible to use them.  The default is to make hard links where
possible, and make copies otherwise.  If copy is
.BR always ,
hard links will not be used.  If copy is
.BR never ,
.B unsymlink
will report an error if it cannot make a hard link.
.\" I had some plans for a --move option, that would unlink former
.\" symlink targets, but I keep thinking up cases where this would
.\" do the unexpected.  I figure it's just too dangerous, and it's
.\" better to write a specific tool for removing files that are not
.\" targeted by symlinks.
.TP
.BI "\-l " pathname ", --leave " pathname
Ignore symbolic links that point to (or into)
.IR pathname .
.TP
.BI "\-n, --no\-act"
Dry run: do not make any real changes.  This option implies
.BR --verbose .
.TP
.B "\-q, --quiet"
Do not emit any messages, not even to report errors.  The caller can
still detect errors by checking the exit code.
.TP
.BI "\-s " maxsize ", --size=" maxsize
This option limits the total size of the files that will be unsymlinked.
It is useful for directories that are mirrored to other sites, since
it allows a large-scale unsymlinking operation to be done gradually.
Hard links are counted as their full size, even though they take up
no extra space, because mirrors are generally not aware of hard links
and will mirror them as copies.

The limit is not absolute.
.B unsymlink
will exceed it if it encounters a single file that is larger than
.IR maxsize .
In such a case it will not unsymlink any other files.  Use the
.B --strict\-size
option to forbid this.

.I maxsize
is normally a number of kilobytes.  Append "M" to specify the size
in megabytes instead.
.TP
.BI --strict\-size
Can be used in conjuction with
.B --size
.IR maxsize .
It forces
.B unsymlink
to abort with an error when it has to unsymlink a file that will not fit in
.IR maxsize .
.TP
.BI "\-v, --verbose"
Generate a line of output for each action taken, and a line of
statistics at the end.
.TP
.B --help
Display usage information and exit.
.TP
.B --version
Display version information and exit.
.SH "SEE ALSO"
.BR ln (1),
.BR symlinks (1).
.SH DIAGNOSTICS
.B unsymlink
will exit with a failure code in these circumstances:
.RS
.PP
Any of its command line arguments did not exist.
.PP
Any of its unsymlinking operations failed (for example, due to lack of
read or write permissions).
.PP
.BI --copy= never
was specified, and hard links could not be used for all files.
.PP
.BI --strict-size
was specified, and the first symlink encountered had a target larger
than the maximum size.
.RE
.PP
In all these cases, an error message will be printed, unless
.B --quiet
was given.
.SH BUGS
This tool is not yet implemented.
.SH AUTHOR
Richard Braakman <dark@xs4all.nl>

Reply to: