| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
This adds a `-s` that can be used to override the `SYMLINK_DIRS` config,
or the `-S` flag, to lsrc(1), mkrc(1), rcup(1), and rcdn(1).
The `-s` flag is the opposite of -S: any argument, if it is a directory,
is not symlinked but instead recurred down.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The lsrc(1), mkrc(1), rcup(1), and rcdn(1) commands will now print a
usage message and exit immediately (with 64, `EX_USAGE`) when given an
option it does not understand.
This includes `--version` and `--help`.
Normal `-h` will print usage and exit successfully, as normal.
Closes #59.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New flags have accumulated without proper care for the usage
instructions or man pages.
I manually went through each program and verified its usage instruction
against its `getopts`, then I alphabeticalized the usage message.
Based on the usage message, I then verified the synposis in the manpage.
Then, based on the synposis, I alphabeticalized the detailed listing of
the arguments and filled in the missing pieces. The `-h` and `-V`
arguments were missing from all manpages.
In the future we will need to be more careful about this. It would be
good to automate a checker that refuses to build unless the docs have
all the flags mentioned.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Based on issue #82, we now provide `-B` to override the hostname. In
particular:
- `mkrc -B foo` will enable `-o` but with the hostname set up `foo`.
- `lsrc -B foo` will work like normal `lsrc` except it treats `host-foo`
as the host-specific directory.
- `rcup -B foo` will run a normal `rcup` except `host-foo` is the
host-specific directory.
- `rcdn -B foo` is just like normal `rcdn`, but with `host-foo` as the
host-specific directory.
The `HOSTNAME` can also be set in the rcrc(5), and this is overridden by
the aforementioned `-B`.
While making this change: The `test/Makefile.am` used a mix of tabs and
spaces. Since it's a Makefile, replace it all with tabs.
|
|
|
|
|
|
|
|
| |
A `break` anywhere inside a `for` loop (even inside a `case`) will exit
from the innermost loop. Replace the `break` with a `:` to get the
desired effect.
Spotted by Pat Brisin.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is best explained with an example. If I want to track a file like
`~/.bundle/config`, the correct way would be:
~$ mkrc ~/.bundle/config
--> ~/.dotfiles/bundle/config
But if you are already inside the directory, say:
~/.bundle $
and you ran:
~/.bundle $ mkrc con<TAB> # for autocomplete
~/.bundle $ mkrc config
--> ~/.dotfiles/.config
Which is obviously not what you meant.
This basically checks first if the file exists in the current working
directory and if it is, it's expand the full path.
~/.bundle $ mkrc config
--> ~/.dotfiles/bundle/config
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The bug:
~% ls -1 test-dotfiles/**/*(.)
test-dotfiles/tag-openbsdbox/zshrc_alias
test-dotfiles/tag-openbsdbox/zshrc_bsd
test-dotfiles/tag-zsh/zshrc
~% lsrc -t openbsdbox -t zsh -d test-dotfiles
/home/mike/.zshrc_alias:/home/mike/test-dotfiles/tag-openbsdbox/zshrc_alias
/home/mike/.zshrc_bsd:/home/mike/test-dotfiles/tag-openbsdbox/zshrc_bsd
~%
We expect to also see:
/home/mike/.zshrc:/home/mike/test-dotfiles/tag-zsh/zshrc
This arises because we were checking for files the start with another
name, rather than a full equality.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under Solaris, use ksh instead of `/bin/sh`.
This uses `$SHELL` as a POSIX shell, coupled with a `configure` check
that sets it correctly.
Note that the POSIX shell might end up being bash, so this actually
introduces more fragmentation than it reduces.
Taken from https://github.com/freedreno/mesa/blob/master/configure.ac
|
|
|
|
|
|
|
|
|
|
| |
The `-v` (verbose) flag for `cp`, `ln`, and `rm` is not standard. It is
simple to implement using shell functions, so introduce `cp_v`, `ln_v`,
and `rm_v`. These shell functions use the existing `$VERBOSE` variable
for printing, which simplifies the code and reduces the number of
variables.
Fixes #61.
|
|
|
|
|
|
|
|
|
| |
Most of this commit is actually about $IFS.
Modifying the environment for a single invocation (i.e. with `VAR=x
command` or `env VAR=x command`) only works for actual commands, not a
built-in like `set`. Consequently, we must manually store the existing
$IFS value and restore it after invoking `set`.
|
|
|
|
|
| |
* http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_03
* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08
|
|
|
|
|
| |
The original `SYMLINK_DIRS` pull request had ignored the tag- and
host-specific sections. This brings them back into being.
|
|
|
|
|
|
|
|
|
| |
* http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_03
* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08
Fixes #46.
This does not handle quotes around `$@`. That is taken separately in #53.
|
| |
|
|
|
|
|
|
|
|
|
| |
This allows for users to run this command from within directories that
have spaces in their path.
I've also quoted `DOTFILES_DIR` in more places, but this is so far a
waste: we still don't support dotfiles directories with spaces in their
name.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This case fails:
~% lsrc -d foo -d bar
/home/mike/.zshrc:/home/mike/foo/zshrc
Because:
skipping non-existent directory: /home/mike/foo/bar
However, giving the absolute path fixes it:
~% lsrc -d $PWD/foo -d $PWD/bar
/home/mike/.zshrc:/home/mike/foo/zshrc
/home/mike/.vimrc:/home/mike/bar/vimrc
In this commit we fix this by storing the user's working directory when
they start, and always `cd`ing back before changing dotfile directory.
In this way they are always relative to the current working directory.
Fixes #21.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
It introduces the `Makefile.am` from gitsh, and abstracts it a bit. This
`Makefile.am`, or most of it, could be dropped into gitsh again. How to
use it is documented in `DEVELOPERS.md`.
The whole release process is more consistent and simple: `make release`
to build a tarball, Homebrew, Arch, Debian, HTML (from manpages), and
tag it, pushed to the various repos, and with cleanup. The `release`
target is composed of smaller targets that stack well.
|
|
|
|
|
|
|
| |
The `$` sigil in `-F` indicates that the directory is symlinked instead
of recurred upon.
Fixes #37.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Typically a directory structure is copied instead of symlinked, while
files are symlinked. However, some cases require symlinked dirs: git
submodules, vim plugins, and so on.
This introduces a `SYMLINK_DIRS` option for rcrc(5) that takes a
space-separated list of "exclude patterns". Any directory matching these
patterns is symlinked.
This also introduces a `-S` argument for lsrc(1), rcup(1), and rcdn(1).
This argument takes a pattern, for one-off directory symlinking. It can
be repeated.
This also introduces `-S` and `-s` for mkrc(1). `-S` will re-install the
files as symlinks, and `-s` will not.
This does work with `-C`, though perhaps unintuitively - we don't know
what the user means in this case. However, it will not crash.
Bug: `-s` does not work right if `SYMLINK_DIRS` is set. Bug #36
addresses this.
|
|
|
|
|
|
|
|
|
| |
* Centralize configuration loading in rcm.sh(.in)
* Check for readability, not just existence
Add RCRC notes to all manpages. Putting the environment variables in a
table lines them up more neatly and definitively, across all output
formats, and also follows the examples used by e.g. BSD ls(1).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I found that after you add a file with `mkrc` command from any dir, the output
looks like:
$ mkrc ~/.my-awesome-dot-file
‘$HOME/.my-awesome-dot-file -> ‘$HOME/.dotfiles/my-awesome-dot-file'
‘$HOME/.my-awesome-dot-file -> ‘$HOME/.dotfiles/my-awesome-dot-file'
$
It looks like the output it's appearing twice, which could led you believe
something went wrong or the output is a bit buggy. Obivously, it's not, and the
command ran without problems.
Use `$PRINT` to show which step it is on before the verbose messages are
displayed.
|
|
|
|
|
| |
This is what FreeBSD has in its ports tree and is the latest as of 21
June 2013.
|
|
|
|
| |
Running autogen.sh changes these files. Clearly they must be important.
|
|
|
|
| |
Quick usage summaries for the four commands.
|
|
|
|
|
| |
The hooks can be skipped using `-K`, if needed and they can be forced
with the `-k` flag.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are programs that, if they exist, will run before or after the
syncronization/removal is run. Three use cases caused this:
1. The thoughtbot dotfiles will run a vundle installation set of
commands after intitial synchronization.
2. I changed the location of `.bash_history` to `.bash/history` and
wanted to move `.bash_history` to `.bash/history` after up to preserve
existing history.
3. Moving from an existing old-style custom install script to `rcup`
might require some cleanup; this happened in practice, and required a
simple script.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Since the `-e` flag was for exclude patterns, and since it's rare for a
word with an `x` to come along, change the `-e` flag to `-x`. Better to
do it now before a new release.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Picture this case:
% ls -l ~/.a
~/.a -> ~/.dotfiles/a
% tree ~/.dotfiles/a
a
`-- b
`-- c
`-- d
`-- foo
Ideally we would want `~/.a/b/c/d/foo` to be the symlink, and the rest
to be actual directories. However, some people did it differently.
Running `rcdn` on the above would previously have removed `foo` from
`~/.dotfiles`. Now, it removes `~/.a` and nothing more.
|
|
|
|
| |
This is what is in Debian testing.
|
|
|
|
|
|
| |
`lsrc` was stripping hostname domain suffixes, but `mkrc` was not meaning
that `mkrc -o` didn't work correctly with a suffix. This was particularly
noticeable on OS X where the hostname has a `.local` suffix by default.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some files prefer to be copies instead of symlinks---for example,
OpenSSH ignores symlinks. Add the `-C` option to mkrc(1) and rcup(1) to
handle this.
mkrc -C .ssh
rcup -C ssh
This does raise a synchronization problem that I do not yet know how to
solve; namely, what to do when the rc file changes. Perhaps a `rcsync`
command is in order; perhaps `rcup` should handle this; perhaps `rcsync`
is a better name for `rcup`.
|
|
|
|
|
|
|
|
|
|
|
| |
The `-I` flag serves as an "undo" for the `-e` pattern. It overrides any
matching exclusions, allowing for temporary
listing/installation/removal.
For example, if you want to try a `.pythonrc` but leave it in your
`EXCLUDES` in rcrc(5), you can do:
rcup -Ipythonrc pythonrc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The lsrc(1), rcup(1), and rcdn(1) commands now take any number of `-e`
flags, used to specify an exclusion pattern. This can also be controlled
via rcrc(5), the `EXCLUDES` variable.
An exclusion pattern specifies a file glob to skip. In the case of
lsrc(1), any file matching the glob is not listed; in rcup(1) it is not
symlinked; and in rcdn(1) it is not removed.
The file glob can be preceded by the name of a dotfiles directory
(separated from the file glob by a colon) to increase the specificity.
Useful for:
rcdn -e rcrc
rcup -d work-dotfiles -e bashrc
rcup -d ~/.dotfiles -d wife-dotfiles -d sys-dotfiles -e wife-dotfiles:tigrc
|
|
|
|
| |
I'll figure out `make release` someday.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the `-f` and `-i` options to rcup(1). `-f` will overwrite any file
it doesn't recognize; `-i` will prompt each time, and is the default.
For example:
rm ~/.zshrc
touch ~/.zshrc
rcup -f # overwrite that .zshrc with the symlink
rcup -i # prompt whether to overwrite that .zshrc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This program will remove all your rc files that are symlinked. This can
be further controlled by `-d` and `-t`.
For example, you can feel comfortable trying new rc files because you
can quickly remove them again with `-d`.
rcup -d thoughtbot-dotfiles
rcdn -d thoughtbot-dotfiles
Likewise, when you're done with Python just drop it:
rcdn -t python
|
|
|
|
|
|
|
|
|
| |
Due to the awesome refactoring in
fe3244ca9c8c9a38ea700851e36667b1015d11e6, the `-t` and `-d` options were
broken. Fix it by removing the `handle_metadata_flags` function and
inlining the code again, and build the `LS_ARGS` argument differently.
Clearly I need a test suite.
|
|
|
|
|
|
|
|
| |
To make it easier to manage host-specific rc files, `mkrc` now supports
a `-o` option. This causes the specified file to be added to the host
section named for the current machine.
This option is in conflict with the `-t` option.
|
|
|
|
|
|
| |
Pull the `-V`, `-v`, `-q`, `-t`, and `-d` out into the
`handle_common_flags` and `handle_metadata_flags` functions, shared
between the different programs.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `make release` command will build the Debian package, push the
version to a git tag on GitHub, and upload the docs to GitHub pages.
This also adds a `deb` target, along with `build-docs`, `upload-docs`,
`build-tag`, and `push-tag`.
In addition, introduce a `NEWS.md` file.
Both `rcm.sh.in` and `NEWS.md.in` will act as input files. This is to
abstract over the version number.
|
|
|
|
|
|
| |
The Makefile.in generated from automake 1.14 is backward compatible, but
not forward compatible. This allows it to build on more systems, such as
Arch and OS X.
|
|
|
|
|
|
|
|
|
| |
Bugfix: passing `-d` to `mkrc` previously did not make the symlink. This
is now fixed.
We have previously installed the file by calling `rcup`, but we never
passed the `-d` flag to `rcup`. Instead, we `cd`ed. This changes it: no
`cd`, pass the `-d` flag.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `lsrc` command (and thus the other commands, too) now supports
passing a relative directory name to `-d`. Previously, this caused only
the non-host and non-tag directories to run; now all dotfiles
directories are run for all metafiles, too.
As an example, this now works correctly:
lsrc -d dotfiles
This still works, too:
lsrc -d /home/mike/dotfiles
|
|
|
|
|
|
|
|
|
| |
The following command can generate a Debian package:
debuild -us uc
The directory structure and tarball must be perfectly set up first. This
is documented in `DEVELOPERS.md`.
|
|
|
|
| |
Replace the `Makefile` with a `configure.ac` and a set of `Makefile.am`.
|
|
|
|
|
|
| |
The `/usr/local/libexec` standard looks awkward on Debian, so after
careful and sad evaluation we've concluded that we do not, in fact,
execute the `rcm.sh` library. Move it to `/usr/local/share` instead.
|