From 8d7f6c94a3458328b339b6582592b6c1fecec950 Mon Sep 17 00:00:00 2001 From: Mike Burns Date: Sun, 11 Aug 2013 17:29:01 +0200 Subject: Add the COPY_ALWAYS option The suite now honors the `COPY_ALWAYS` option in rcrc(5). This can be set to a space-separated list of file globs. Any file matching a glob is copied instead of symlinked. This is handy both for secure programs (`netrc`, `ssh/id_*`) and for programs that oddly re-write files (`weechat/*`). To always copy everything, use the `*` glob. This is reflected throughout the suite as follows: * lsrc now has a `-F` option which shows a symbol to indicate whether it is a symlink (`@`) or a copy (`X`). * rcdn only removes symlinks unless the file under question matches a `COPY_ALWAYS` glob, in which case it is removed regardless of whether it is a symlink. * rcup will copy instead of symlinking any file that matches any `COPY_ALWAYS` glob. --- man/lsrc.1 | 21 +++++++++++++++++---- man/rcdn.1 | 13 ++++++++++++- man/rcrc.5 | 7 +++++++ man/rcup.1 | 8 +++++++- 4 files changed, 43 insertions(+), 6 deletions(-) (limited to 'man') diff --git a/man/lsrc.1 b/man/lsrc.1 index f8e675c..b733873 100644 --- a/man/lsrc.1 +++ b/man/lsrc.1 @@ -6,7 +6,7 @@ .Nd show configuration files .Sh SYNOPSIS .Nm lsrc -.Op Fl vq +.Op Fl Fvq .Op Fl d Ar dir .Op Fl I Ar excl_pat .Op Fl t Ar tag @@ -25,12 +25,21 @@ section, for details on the directory layout. It supports these options: . .Bl -tag -.It Fl t Ar TAG -list dotfiles according to TAG -. .It Fl d Ar DIR list dotfiles from the DIR. This can be specified multiple times. . +.It Fl F +show symbols next to each file indicating status information. Supported +symbols are +.Li @ +which indicates that the file is a symlink, and +.Li X +to indicate that the file is a copy. More details on copied files can be +found in +.Xr rcrc 5 , +under the documentation about +.Va COPY_ALWAYS . +. .It Fl I Ar excl_pat include the files that match the given pattern. This is applied after any @@ -40,6 +49,10 @@ options. It uses the same pattern language as more details are in the .Sx EXCLUDE PATTERN section. +. +.It Fl t Ar TAG +list dotfiles according to TAG +. .It Fl v increase verbosity. This can be repeated for extra verbosity. . diff --git a/man/rcdn.1 b/man/rcdn.1 index 2981bbc..6c641c9 100644 --- a/man/rcdn.1 +++ b/man/rcdn.1 @@ -13,13 +13,24 @@ .Op Fl x Ar excl_pat .Op Ar files ... .Sh DESCRIPTION -This program will remove all the rc file symlinks that the +This program will remove all the rc files that the .Xr rcm 7 suite knows about. This can be further controlled with the .Fl t and .Fl d flags. +.Pp +The files that are removed are symlinks. However, the +.Va COPY_ALWAYS +setting in +.Xr rcrc 5 +modifies this. If a rc file is not a symlink but an ancestor directory +is, that directory is removed. If a rc file is not a symlink but is +listed in +.Va COPY_ALWAYS +the file is removed. +. .Bl -tag .It Fl d Ar DIR remove rc files from the diff --git a/man/rcrc.5 b/man/rcrc.5 index f14eecf..c7f300a 100644 --- a/man/rcrc.5 +++ b/man/rcrc.5 @@ -28,22 +28,29 @@ programs. .Pp It supports these variables: .Bl -tag +.It Va COPY_ALWAYS +always copy files that match the listed globs, never symlink them. +. .It Va DOTFILES_DIRS the source directories for dotfiles. The first in the list is the canonical source. The default value is .Li ~/.dotfiles +. .It Va EXCLUDES a space-separated list of exclude patterns. Exclude patterns are explained in detail in .Xr lsrc 1 under the section .Sx EXCLUDE PATTERN . +. .It Va TAGS the default tags. .El .Sh FILES .Pa ~/.rcrc .Sh EXAMPLES +.Dl COPY_ALWAYS="ssh/id_* weechat/* netrc" +.Dl COPY_ALWAYS="*" .Dl DOTFILES_DIRS="/home/mike/.dotfiles /usr/share/dotfiles" .Dl EXCLUDES="irbrc *:*emacs* dotfiles:python*" .Dl TAGS="freebsd development email git laptop gmail notmuch" diff --git a/man/rcup.1 b/man/rcup.1 index 0b265ab..99fa364 100644 --- a/man/rcup.1 +++ b/man/rcup.1 @@ -76,7 +76,13 @@ will be installed into \&. .Pp Files are installed as symlinks. Directories are installed by making -directories. +directories. The +.Fl C +flag causes files to be installed as copies instead of symlinks. The +.Va COPY_ALWAYS +option in +.Xr rcrc 5 +can be used to list files that must only be copied. .Pp Two meta files are supported: host-specific files and tagged files. .Pp -- cgit v1.2.3