@c
@c ================================================================================
@c                               Edition 1.1
@c                      of the Texinfo-manuals for the
@c                      (R)evision (C)ontrol (S)ystem
@c                               Version 5.7
@c
@c                  (c) 1982, 1988, 1989 Walter F. Tichy.
@c           (c) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert.
@c        (c) 1996, 1997 Karl Heinz Marbaise (doing converting job)
@c ================================================================================
@c
@c Discription:
@c    clean working files.
@c
@c Authors:
@c    Walter Tichy,
@c    Paul Eggert,
@c    Karl Heinz Marbaise (doing converting job)
@c
@c e-mail:
@c    Internet: KHMarbaise@p69.ks.fido.de
@c    Fido-net: 2:2452/117.69
@c
@c Bugs, question:
@c    to above e-mail adress.
@c
@c License:
@c    The "Texinfo Edition of the RCS V5.7 manuals" are free
@c    software; you can redistribute it and/or modify it under
@c    the terms of the GNU General Public License as published
@c    by the Free Software Foundation; either version 2, or (at
@c    your option) any later version.
@c
@c    The "Texinfo Edition of the RCS V5.7 manuals" are distributed
@c    in the hope that they will be useful, but WITHOUT ANY WARRANTY;
@c    without even the implied warranty of MERCHANTABILITY or
@c    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
@c    License for more details.
@c
@c    You should have received a copy of the GNU General Public License
@c    along with the "Texinfo Edition of the RCS V5.7 manuals"; see the
@c    file COPYING. If not, write to the:
@c    Free Software Foundation,
@c    59 Temple Place - Suite 330,
@c    Boston, MA 02111-1307, USA.
@c
@c    See \rcstxi.110\COPYING for details.
@c
@c ================================================================================
@c
@c
@c $Id: RCSCLEAN.TEX 1.2 1997/03/30 22:53:15 KHM Exp $
@c
@c =============================================================================
@c rcsclean -- clean up working files
@c -----------------------------------------------------------------------------
@node rcsclean,rcsdiff,ident,Top
@chapter rcsclean -- clean up working files
@cindex rcsclean
@cindex clean up
@cindex working files
@menu
* rcscleanIntro::       Introduction to @code{rcsclean}.

* rcscleanOptions::     command line options of @code{rcsclean}.
* rcscleanExamples::    Examples in using @code{rcsclean}.
* rcscleanFiles::       Files.
* rcscleanEnv::         The Environment which can change the
                        behaviour of much of the RCS commands.
* rcscleanDiag::        Diagnostic output of @code{rcsclean}.
* rcscleanBugs::        Bugs.
@end menu
@c =============================================================================
@c rcsclean -- clean up working files
@c     Description
@c -----------------------------------------------------------------------------
@node rcscleanIntro,rcscleanOptions,,rcsclean
@section Description
@code{rcsclean}  removes  files  that  are  not  being worked on.
@code{rcsclean -u} (@ref{rcscleanOptu}) also unlocks and removes
files that are  being worked on but have not changed.

For  each  @file{file} given, rcsclean compares the working file
and a revision in the corresponding RCS file.  If it finds
a  difference,  it  does  nothing.   Otherwise,  it  first
unlocks the revision if the @code{-u} (@xref{rcscleanOptu}
 option is given,  and  then
removes  the  working  file  unless  the  working  file is
writable and the revision is locked.  It logs its  actions
by  outputting the corresponding @code{rcs -u} (@xref{rcsOptu})
and @code{rm -f} commands on the standard output.

Files are paired as explained in @ref{ciFiles}.
If  no  @file{file} is
given,  all  working  files  in  the current directory are
cleaned.  Pathnames matching  an  RCS  suffix  denote  RCS
files; all others denote working files.

The  number  of  the revision to which the working file is
compared may be attached to any of the options @code{-n},
@code{-q}, @code{-r}, or @code{-u}.
If no revision number is specified, then if the @code{-u}
option is given and the caller has  one  revision  locked,
rcsclean  uses  that revision; otherwise rcsclean uses the
latest revision on the default branch, normally the  root.

@code{rcsclean} is  useful  for clean targets in makefiles.
@xref{rcsdiff}, which prints  out  the  differences,  and
@code{ci} (@ref{ciIntro}),  which normally reverts to the
previous revision if a file was not changed.


@c =============================================================================
@c rcsclean -- clean up working files
@c     Options
@c -----------------------------------------------------------------------------
@node rcscleanOptions,rcscleanExamples,rcscleanIntro,rcsclean
@section Command line options of rcsclean
@ifinfo
Overview off all options which can be given to @code{rcsclean}

@code{Synopsis}: rcsclean [options] [ file @dots{} ]
@end ifinfo
@menu
* rcscleanOptk::   -k Keyword substitution.
* rcscleanOptn::   -n Do not unlock or remove.
* rcscleanOptq::   -q Quiet mode.
* rcscleanOptr::   -r Revision for comparison.
* rcscleanOptT::   -T Modification time.
* rcscleanOptu::   -u unlock revisions.
* rcscleanOptV::   -V Version; Emulation RCS Version.
* rcscleanOptx::   -x Suffixes.
* rcscleanOptz::   -z Time zone.
@end menu
@c =============================================================================
@c rcsclean -- clean up working files
@c     Options
@c         option -k
@c -----------------------------------------------------------------------------
@node rcscleanOptk,rcscleanOptn,,rcscleanOptions
@subsection Keyword substitution
@cindex -k
@cindex Keyword
@table @code
@item -k@file{subst}

Use @file{subst} style keyword substitution when  retrieving
the  revision  for  comparison.  See @ref{coKeyword}
for details.

@end table
@c =============================================================================
@c rcsclean -- clean up working files
@c     Options
@c         option -n
@c -----------------------------------------------------------------------------
@node rcscleanOptn,rcscleanOptq,rcscleanOptk,rcscleanOptions
@subsection No removing
@cindex -n
@cindex remove
@cindex unlock
@table @code
@item -n@file{rev}

Do not actually remove  any  files  or  unlock  any
revisions.   Using  this  option will tell you what
@code{rcsclean} would do without actually doing it.
@end table
@c =============================================================================
@c rcsclean -- clean up working files
@c     Options
@c         option -q
@c -----------------------------------------------------------------------------
@node rcscleanOptq,rcscleanOptr,rcscleanOptn,rcscleanOptions
@subsection Quiet mode
@cindex -q
@cindex Quiet
@table @code
@item -q@file{rev}

Do not log the actions taken on standard output.
@end table
@c =============================================================================
@c rcsclean -- clean up working files
@c     Options
@c         option -r
@c -----------------------------------------------------------------------------
@node rcscleanOptr,rcscleanOptT,rcscleanOptq,rcscleanOptions
@subsection Revision for comparison
@cindex -r
@cindex Revision
@cindex comparison
@table @code
@item -r@file{rev}

This option has no effect other than specifying the
revision for comparison.

@end table
@c =============================================================================
@c rcsclean -- clean up working files
@c     Options
@c         option -T
@c -----------------------------------------------------------------------------
@node rcscleanOptT,rcscleanOptu,rcscleanOptr,rcscleanOptions
@subsection Modification time
@cindex -T
@cindex Modification
@cindex time/date
@table @code
@item -T

Preserve the modification time on the RCS file even
if the RCS file changes because a lock is  removed.
This  option  can  suppress extensive recompilation
caused by a @code{make} dependency of some  other  copy
of  the  working  file  on  the RCS file.  Use this
option with care;  it  can  suppress  recompilation
even  when it is needed, i.e. when the lock removal
would mean a change to keyword strings in the other
working file.

@end table
@c =============================================================================
@c rcsclean -- clean up working files
@c     Options
@c         option -u
@c -----------------------------------------------------------------------------
@node rcscleanOptu,rcscleanOptV,rcscleanOptT,rcscleanOptions
@subsection Unlock revision
@cindex -u
@cindex Unlock revision
@table @code
@item -u@file{rev}

Unlock  the revision if it is locked and no difference is found.

@end table
@c =============================================================================
@c rcsclean -- clean up working files
@c     Options
@c         option -V
@c -----------------------------------------------------------------------------
@node rcscleanOptV,rcscleanOptx,rcscleanOptu,rcscleanOptions
@subsection Version and Emulation
@cindex -V
@cindex RCS Version
@cindex Emulation of RCS Version
@table @code
@item -V

Print RCS's version number.

@item -V@file{n}

Emulate RCS version @file{n}.  @xref{coOptV} for details.
@end table
@c =============================================================================
@c rcsclean -- clean up working files
@c     Options
@c         option -x
@c -----------------------------------------------------------------------------
@node rcscleanOptx,rcscleanOptz,rcscleanOptV,rcscleanOptions
@subsection Suffixes
@cindex -x
@cindex Suffixes
@table @code
@item -x@file{suffixes}

Use @file{suffixes} to characterize RCS files.  See  @ref{ciOptx}
for details.
@end table
@c =============================================================================
@c rcsclean -- clean up working files
@c     Options
@c         option -t
@c -----------------------------------------------------------------------------
@node rcscleanOptz,,rcscleanOptx,rcscleanOptions
@subsection Time zone
@cindex -z
@cindex Time zone
@table @code
@item -z@file{zone}

@code{-z@file{zone}} Use @file{zone} as the time zone for keyword substitution;
see @ref{coOptz} for details.
@end table

@c =============================================================================
@c rcsclean -- clean up working files
@c     Examples
@c -----------------------------------------------------------------------------
@node rcscleanExamples,rcscleanFiles,rcscleanOptions,rcsclean
@section Examples
@cindex Examples

@example
rcsclean  *.c  *.h
@end example


removes all working files ending in .c or .h that were not
changed since their checkout.


@example
rcsclean
@end example


removes  all  working  files in the current directory that
were not changed since their checkout.

@c =============================================================================
@c rcsclean -- clean up working files
@c     Files
@c -----------------------------------------------------------------------------
@node rcscleanFiles,rcscleanEnv,rcscleanExamples,rcsclean
@section Files
@cindex Files
rcsclean accesses files much as @code{ci} (@ref{ciFiles})does.

@c =============================================================================
@c rcsclean -- clean up working files
@c     Envrionment
@c -----------------------------------------------------------------------------
@node rcscleanEnv,rcscleanDiag,rcscleanFiles,rcsclean
@section Environment
@cindex Environment
@table @code
@item RCSINIT
options prepended to the argument list, separated by spaces.
See @ref{ciEnv} for details.

@end table
@c =============================================================================
@c rcsclean -- clean up working files
@c     Diagnostics
@c -----------------------------------------------------------------------------
@node rcscleanDiag,rcscleanBugs,rcscleanEnv,rcsclean
@section Diagnostics
The exit status is zero if and only if all operations were
successful.   Missing  working  files  and  RCS  files are
silently ignored.
@c =============================================================================
@c rcsclean -- clean up working files
@c     Bugs
@c -----------------------------------------------------------------------------
@node rcscleanBugs,,rcscleanDiag,rcsclean
@section Bugs
At  least  one  @file{file} must be given in older Unix versions
that do not provide the needed directory  scanning  operations.

