| 1 |
.Dd July 28, 2013 |
| 2 |
.Dt RCUP 1 |
| 3 |
.Os |
| 4 |
.Sh NAME |
| 5 |
.Nm rcup |
| 6 |
.Nd update and install dotfiles managed by rcm |
| 7 |
.Sh SYNOPSIS |
| 8 |
.Nm rcup |
| 9 |
.Op Fl CfhiKkqVv |
| 10 |
.Op Fl B Ar hostname |
| 11 |
.Op Fl d Ar dir |
| 12 |
.Op Fl g |
| 13 |
.Op Fl I Ar excl_pat |
| 14 |
.Op Fl S Ar excl_pat |
| 15 |
.Op Fl s Ar excl_pat |
| 16 |
.Op Fl t Ar tag |
| 17 |
.Op Fl U Ar excl_pat |
| 18 |
.Op Fl u Ar excl_pat |
| 19 |
.Op Fl x Ar excl_pat |
| 20 |
.Op Ar files ... |
| 21 |
.Sh DESCRIPTION |
| 22 |
This is a program to update and install personal dotfiles. These |
| 23 |
dotfiles are managed in a separate directory. Use |
| 24 |
.Nm rcup |
| 25 |
to install files from your dotfiles directories or from host- or |
| 26 |
tag-specific directories within. |
| 27 |
.Pp |
| 28 |
See |
| 29 |
.Sx DIRECTORY LAYOUT |
| 30 |
for details on the directory layout. |
| 31 |
.Pp |
| 32 |
It supports these options: |
| 33 |
.Bl -tag -width "-x EXCL_PAT" |
| 34 |
.It Fl B Ar HOSTNAME |
| 35 |
treat |
| 36 |
.Pa host-HOSTNAME |
| 37 |
as the host-specific directory instead of computing it. |
| 38 |
.It Fl C |
| 39 |
copy the files instead of symlinking them. |
| 40 |
.It Fl d Ar DIR |
| 41 |
install dotfiles from the |
| 42 |
.Ar DIR . |
| 43 |
This can be specified multiple times. |
| 44 |
.It Fl f |
| 45 |
if the rc file already exists in your home directory but does not match |
| 46 |
the file in your dotfiles directory, remove the rc file then create the |
| 47 |
symlink. |
| 48 |
.It Fl g |
| 49 |
print to |
| 50 |
.Li stdout |
| 51 |
a standalone shell script that will run the |
| 52 |
.Nm |
| 53 |
command as specified. |
| 54 |
Nothing on your filesystem will be modified by |
| 55 |
.Nm |
| 56 |
when this flag is passed. |
| 57 |
.It Fl h |
| 58 |
show usage instructions. |
| 59 |
.It Fl I Ar EXCL_PAT |
| 60 |
install rc files that match |
| 61 |
.Ar EXCL_PAT |
| 62 |
despite being excluded by the |
| 63 |
.Fl x |
| 64 |
flag or a setting in |
| 65 |
.Xr rcrc 5 . |
| 66 |
This can be repeated with additional patterns. See |
| 67 |
.Xr lsrc 1 , |
| 68 |
.Sx EXCLUDE PATTERN , |
| 69 |
for more details. |
| 70 |
.It Fl i |
| 71 |
if the rc file already exists in your home directory but does not match |
| 72 |
the file in your dotfiles directory, prompt for how to handle it. This |
| 73 |
is the default. |
| 74 |
.It Fl K |
| 75 |
skip pre- and post-hooks. |
| 76 |
.It Fl k |
| 77 |
run pre- and post-hooks (see |
| 78 |
.Sx DIRECTORY LAYOUT |
| 79 |
for more details on hooks). This is the default. |
| 80 |
.It Fl S Ar EXCL_PAT |
| 81 |
any rc file that matches |
| 82 |
.Ar EXCL_PAT |
| 83 |
is installed using a symlink even if it is a directory. This option |
| 84 |
can be repeated. |
| 85 |
.It Fl s Ar EXCL_PAT |
| 86 |
any file that matches |
| 87 |
.Ar EXCL_PAT |
| 88 |
is installed as normal, in accordance with the |
| 89 |
.Sx ALGORITHM |
| 90 |
section below. This is the opposite of |
| 91 |
.Fl S . |
| 92 |
This option can be repeated. |
| 93 |
.It Fl t Ar TAG |
| 94 |
install dotfiles according to |
| 95 |
.Ar TAG . |
| 96 |
.It Fl U Ar EXCL_PAT |
| 97 |
any rc file that matches |
| 98 |
.Ar EXCL_PAT |
| 99 |
is installed without a leading dot. This option can be repeated. See the |
| 100 |
documentation of the |
| 101 |
.Fl U |
| 102 |
option in |
| 103 |
.Xr lsrc 1 |
| 104 |
for more information. |
| 105 |
.It Fl u Ar EXCL_PAT |
| 106 |
any rc file that matches |
| 107 |
.Ar EXCL_PAT |
| 108 |
is installed with a leading dot. This is the opposite of |
| 109 |
.Fl U . |
| 110 |
This option can be repeated. This is the default. See the documentation of the |
| 111 |
.Fl u |
| 112 |
option in |
| 113 |
.Xr lsrc 1 |
| 114 |
for more information. |
| 115 |
.It Fl q |
| 116 |
decrease verbosity. |
| 117 |
.It Fl V |
| 118 |
show the version number. |
| 119 |
.It Fl v |
| 120 |
increase verbosity. |
| 121 |
This can be repeated for extra verbosity. |
| 122 |
Verbose messages are printed to |
| 123 |
.Li stderr . |
| 124 |
.It Fl x Ar EXCL_PAT |
| 125 |
do not install rc files that match |
| 126 |
.Ar EXCL_PAT . |
| 127 |
This can be repeated with additional patterns. See |
| 128 |
.Xr lsrc 1 , |
| 129 |
.Sx EXCLUDE PATTERN , |
| 130 |
for more details. |
| 131 |
.It Ar files |
| 132 |
only install the specified file(s) |
| 133 |
.El |
| 134 |
.Sh DIRECTORY LAYOUT |
| 135 |
Any non-dot non-meta file or directory under your dotfiles directory will be |
| 136 |
installed as a dotfile. For example, |
| 137 |
.Pa .dotfiles/zshrc |
| 138 |
will be installed into |
| 139 |
.Pa ~/.zshrc |
| 140 |
\&. |
| 141 |
.Pp |
| 142 |
Files are installed as symlinks. Directories are installed by making |
| 143 |
directories. The |
| 144 |
.Fl C |
| 145 |
flag causes files to be installed as copies instead of symlinks. The |
| 146 |
.Va COPY_ALWAYS |
| 147 |
option in |
| 148 |
.Xr rcrc 5 |
| 149 |
can be used to list files that must only be copied. Copied files are not |
| 150 |
updated in your dotfiles directory. |
| 151 |
.Pp |
| 152 |
Three meta files are supported: host-specific files, tagged files, |
| 153 |
hooks. |
| 154 |
.Pp |
| 155 |
Host-specific files go in a directory named for the host, prefixed with |
| 156 |
.Pa host- . |
| 157 |
For example, |
| 158 |
.Pa .dotfiles/host-scarlett |
| 159 |
contains files specific to the computer with hostname |
| 160 |
.Pa scarlett , |
| 161 |
and these files will only be installed on the computer with hostname |
| 162 |
.Pa scarlett . |
| 163 |
.Pp |
| 164 |
Tagged files go in a directory named for the tag, prefixed with |
| 165 |
.Li tag- . |
| 166 |
Therefore, files under |
| 167 |
.Pa .dotfiles/tag-git |
| 168 |
are only installed when installing using the |
| 169 |
.Li git |
| 170 |
tag. |
| 171 |
.Pp |
| 172 |
Hooks go in a directory named |
| 173 |
.Pa hooks . |
| 174 |
Two hooks are supported by |
| 175 |
.Nm rcup : |
| 176 |
pre-up and post-up. These go in files or directories with predictable filenames: |
| 177 |
.Pa .dotfiles/hooks/pre-up |
| 178 |
and |
| 179 |
.Pa .dotfiles/hooks/post-up , |
| 180 |
or |
| 181 |
.Pa .dotfiles/hooks/pre-up/* |
| 182 |
and |
| 183 |
.Pa .dotfiles/hooks/post-up/* . |
| 184 |
These files must be executable. They are run every time |
| 185 |
.Nm |
| 186 |
is run, and therefore must be idempotent. |
| 187 |
.Pp |
| 188 |
Hooks will be executed one at a time, sorted alphabetically. For instance, |
| 189 |
.Pa hooks/pre-up/animals |
| 190 |
will run before |
| 191 |
.Pa hooks/pre-up/aquariums , |
| 192 |
and |
| 193 |
.Pa hooks/pre-up/4-eyes |
| 194 |
will run before |
| 195 |
.Pa hooks/post-up/2-u-nothing-compares . |
| 196 |
.Sh ALGORITHM |
| 197 |
It is instructive to understand the process |
| 198 |
.Nm rcup |
| 199 |
uses when synchronizing your rc files: |
| 200 |
.Bl -enum |
| 201 |
.It |
| 202 |
The pre-up hook is run. |
| 203 |
. |
| 204 |
.It |
| 205 |
All non-host, non-tag files without a dot prefix are symlinked to the |
| 206 |
dotted filename in your home directory. So, |
| 207 |
.Pa .dotfiles/tigrc |
| 208 |
is |
| 209 |
symlinked to |
| 210 |
.Pa ~/.tigrc . |
| 211 |
. |
| 212 |
.It |
| 213 |
All non-host, non-tag directories have their structure copied to your |
| 214 |
home directory, then a non-dotted symlink is created within. So for |
| 215 |
example, |
| 216 |
.Pa .dotfiles/vim/autoload/haskell.vim |
| 217 |
causes the |
| 218 |
.Pa ~/.vim/autoload |
| 219 |
directory to be created, then |
| 220 |
.Pa haskell.vim |
| 221 |
is symlinked within. |
| 222 |
. |
| 223 |
.It |
| 224 |
Steps (2) and (3) are applied to host-specific files. These are files |
| 225 |
under a directory named |
| 226 |
.Sm off |
| 227 |
.Pa host- Va $HOSTNAME . |
| 228 |
.Sm on |
| 229 |
. |
| 230 |
.It |
| 231 |
Steps (2) and (3) are applied to tag-specific files. These are files |
| 232 |
under directories named |
| 233 |
.Sm off |
| 234 |
.Pa tag- Va $TAG_NAME , |
| 235 |
.Sm on |
| 236 |
where |
| 237 |
.Va $TAG_NAME |
| 238 |
is the name of each specified tag in turn, taken from the command line |
| 239 |
or from |
| 240 |
.Xr rcrc 5 . |
| 241 |
. |
| 242 |
.It |
| 243 |
The post-up hook is run. |
| 244 |
.El |
| 245 |
. |
| 246 |
.Sh ENVIRONMENT |
| 247 |
.Bl -tag -width ".Ev RCRC" |
| 248 |
.It Ev RCRC |
| 249 |
User configuration file. Defaults to |
| 250 |
.Pa ~/.rcrc . |
| 251 |
.El |
| 252 |
.Sh FILES |
| 253 |
.Pa ~/.dotfiles |
| 254 |
.Pa ~/.rcrc |
| 255 |
.Sh SEE ALSO |
| 256 |
.Xr lsrc 1 , |
| 257 |
.Xr mkrc 1 , |
| 258 |
.Xr rcdn 1 , |
| 259 |
.Xr rcrc 5 , |
| 260 |
.Xr rcm 7 |
| 261 |
.Sh AUTHORS |
| 262 |
.Nm |
| 263 |
is maintained by |
| 264 |
.An "Mike Burns" Aq Mt [email protected] |
| 265 |
and |
| 266 |
.Lk http://thoughtbot.com thoughtbot |