Compare commits
22 commits
abf6ea4b61
...
2d4dcd05ef
Author | SHA1 | Date | |
---|---|---|---|
|
2d4dcd05ef | ||
|
5981f6329e | ||
|
0f8538d3e3 | ||
|
67c684473d | ||
|
8f390cf085 | ||
|
36fda72bec | ||
|
a89e5cee89 | ||
|
075cd1b06b | ||
|
19b7a30668 | ||
|
6304553ab3 | ||
|
24ee841372 | ||
|
87ff97bbd6 | ||
|
f163130609 | ||
|
d49005ce6c | ||
|
2cc64a2fa0 | ||
|
2989734359 | ||
|
7573e18a89 | ||
|
beb83077d8 | ||
|
6a49e849c8 | ||
|
222182b296 | ||
|
0d67c44343 | ||
|
a9e7e7679b |
13 changed files with 304 additions and 163 deletions
5
.github/CONTRIBUTING.md
vendored
5
.github/CONTRIBUTING.md
vendored
|
@ -212,6 +212,11 @@ these principles when making changes.
|
|||
```text
|
||||
$ make test
|
||||
```
|
||||
If you don't use `docker` but an OCI engine akin to `podman`, you can set it through the `OCI` switch for every target
|
||||
|
||||
```text
|
||||
$ make test OCI=podman
|
||||
```
|
||||
|
||||
5. Create a feature branch, based off the `develop` branch.
|
||||
|
||||
|
|
7
CHANGES
7
CHANGES
|
@ -1,3 +1,10 @@
|
|||
3.2.2
|
||||
* Support spaces in distro/distro-family (#432)
|
||||
* Fix zsh hanging when tab completing add/checkout (#417)
|
||||
* Add yadm-untracked script to contributed files (#418)
|
||||
* Fix documentation typos (#425)
|
||||
* Support docker-like OCI engines for dev testing (#431)
|
||||
|
||||
3.2.1
|
||||
* Fix Bash 3 bad array subscript bug (#411)
|
||||
|
||||
|
|
|
@ -12,8 +12,12 @@ Espen Henriksen
|
|||
Cameron Eagans
|
||||
Klas Mellbourn
|
||||
James Clark
|
||||
Glenn Waters
|
||||
Nicolas signed-log FORMICHELLA
|
||||
Tomas Cernaj
|
||||
Joshua Cold
|
||||
jonasc
|
||||
Nicolas stig124 FORMICHELLA
|
||||
Chad Wade Day, Jr
|
||||
Sébastien Gross
|
||||
David Mandelberg
|
||||
|
@ -26,7 +30,6 @@ Siôn Le Roux
|
|||
Mateusz Piotrowski
|
||||
Uroš Golja
|
||||
Satoshi Ohki
|
||||
Nicolas stig124 FORMICHELLA
|
||||
Jonas
|
||||
Franciszek Madej
|
||||
Daniel Wagenknecht
|
||||
|
@ -46,3 +49,4 @@ Thomas Luzat
|
|||
Russ Allbery
|
||||
Brayden Banks
|
||||
Alexandre GV
|
||||
Felipe S. S. Schneider
|
||||
|
|
19
Makefile
19
Makefile
|
@ -1,5 +1,6 @@
|
|||
PYTESTS = $(wildcard test/test_*.py)
|
||||
IMAGE = yadm/testbed:2022-01-07
|
||||
IMAGE = docker.io/yadm/testbed:2022-01-07
|
||||
OCI = docker
|
||||
|
||||
.PHONY: all
|
||||
all:
|
||||
|
@ -94,7 +95,7 @@ test:
|
|||
py.test -v $(testargs); \
|
||||
else \
|
||||
$(MAKE) -s require-docker && \
|
||||
docker run \
|
||||
$(OCI) run \
|
||||
--rm -t$(shell test -t 0 && echo i) \
|
||||
-v "$(CURDIR):/yadm:ro" \
|
||||
$(IMAGE) \
|
||||
|
@ -117,7 +118,7 @@ test:
|
|||
.PHONY: testhost
|
||||
testhost: require-docker .testyadm
|
||||
@echo "Starting testhost"
|
||||
@docker run \
|
||||
@$(OCI) run \
|
||||
-w /root \
|
||||
--hostname testhost \
|
||||
--rm -it \
|
||||
|
@ -129,7 +130,7 @@ testhost: require-docker .testyadm
|
|||
scripthost: require-docker .testyadm
|
||||
@echo "Starting scripthost \(recording script\)"
|
||||
@printf '' > script.gz
|
||||
@docker run \
|
||||
@$(OCI) run \
|
||||
-w /root \
|
||||
--hostname scripthost \
|
||||
--rm -it \
|
||||
|
@ -159,7 +160,7 @@ testenv:
|
|||
|
||||
.PHONY: image
|
||||
image:
|
||||
@docker build -f test/Dockerfile . -t "$(IMAGE)"
|
||||
@$(OCI) build -f test/Dockerfile . -t "$(IMAGE)"
|
||||
|
||||
|
||||
.PHONY: man
|
||||
|
@ -175,7 +176,7 @@ man-ps:
|
|||
@groff -man -Tps ./yadm.1 > yadm.ps
|
||||
|
||||
yadm.md: yadm.1
|
||||
@groff -man -Tascii ./yadm.1 | col -bx | sed 's/^[A-Z]/## &/g' | sed '/yadm(1)/d' > yadm.md
|
||||
@groff -man -Tutf8 -Z ./yadm.1 | grotty -c | col -bx | sed 's/^[A-Z]/## &/g' | sed '/yadm(1)/d' > yadm.md
|
||||
|
||||
.PHONY: contrib
|
||||
contrib: SHELL = /bin/bash
|
||||
|
@ -204,11 +205,11 @@ install:
|
|||
|
||||
.PHONY: sync-clock
|
||||
sync-clock:
|
||||
docker run --rm --privileged alpine hwclock -s
|
||||
$(OCI) run --rm --privileged alpine hwclock -s
|
||||
|
||||
.PHONY: require-docker
|
||||
require-docker:
|
||||
@if ! command -v "docker" > /dev/null 2>&1; then \
|
||||
echo "Sorry, this make target requires docker to be installed."; \
|
||||
@if ! command -v $(OCI) > /dev/null 2>&1; then \
|
||||
echo "Sorry, this make target requires docker to be installed, to use another docker-compatible engine, like podman, re-run the make command adding OCI=podman"; \
|
||||
false; \
|
||||
fi
|
||||
|
|
|
@ -72,7 +72,7 @@ The star count helps others discover yadm.
|
|||
[master-badge]: https://img.shields.io/github/workflow/status/TheLocehiliosan/yadm/Tests/master?label=master
|
||||
[master-commits]: https://github.com/TheLocehiliosan/yadm/commits/master
|
||||
[master-date]: https://img.shields.io/github/last-commit/TheLocehiliosan/yadm/master.svg?label=master
|
||||
[obs-badge]: https://img.shields.io/badge/OBS-v3.2.1-blue
|
||||
[obs-badge]: https://img.shields.io/badge/OBS-v3.2.2-blue
|
||||
[obs-link]: https://software.opensuse.org//download.html?project=home%3ATheLocehiliosan%3Ayadm&package=yadm
|
||||
[releases-badge]: https://img.shields.io/github/tag/TheLocehiliosan/yadm.svg?label=latest+release
|
||||
[releases-link]: https://github.com/TheLocehiliosan/yadm/releases
|
||||
|
|
|
@ -7,6 +7,20 @@ zstyle -T ':completion:*:yadm:argument-1:descriptions:' format && \
|
|||
zstyle -T ':completion:*:yadm:*:yadm' group-name && \
|
||||
zstyle ':completion:*:yadm:*:yadm' group-name ''
|
||||
|
||||
function _yadm-add(){
|
||||
local -a yadm_options yadm_path
|
||||
yadm_path="$(yadm rev-parse --show-toplevel)"
|
||||
yadm_options=($(yadm status --porcelain=v1 |
|
||||
awk -v yadm_path=${yadm_path} '{printf "%s/%s:%s\n", yadm_path, $2, $1}' ))
|
||||
|
||||
_describe 'command' yadm_options
|
||||
_files
|
||||
}
|
||||
|
||||
function _yadm-checkout(){
|
||||
_yadm-add
|
||||
}
|
||||
|
||||
_yadm-alt() {
|
||||
return 0
|
||||
}
|
||||
|
|
9
contrib/commands/README.md
Normal file
9
contrib/commands/README.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
## Contributed Commands
|
||||
|
||||
Although these commands are available as part of the official
|
||||
**yadm** source tree, they have a somewhat different status. The intention is to
|
||||
keep interesting and potentially useful commands here, building a library of
|
||||
examples that might help others.
|
||||
|
||||
I recommend *careful review* of any code from here before using it. No
|
||||
guarantees of code quality is assumed.
|
71
contrib/commands/yadm-untracked
Executable file
71
contrib/commands/yadm-untracked
Executable file
|
@ -0,0 +1,71 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# To run: `yadm-untracked <config-file>`
|
||||
#
|
||||
# If you wish to create a YADM alias to run this as, for example `yadm untracked`
|
||||
# then the following command will add the alias:
|
||||
# `yadm gitconfig alias.untracked '!<PATH>/yadm-untracked'`
|
||||
|
||||
# Possible script improvements:
|
||||
# - Reduce the amount of configuration; I have not figured out a way to
|
||||
# get rid of the non-recursive and ignore. The recursive list could be
|
||||
# built from the directories that are present in `yadm list`
|
||||
|
||||
# Configuration... The script looks at the following 3 arrays:
|
||||
#
|
||||
# yadm_tracked_recursively
|
||||
# The directories and files in this list are searched recursively to build
|
||||
# a list of files that you expect are tracked with `yadm`. Items in this
|
||||
# list are relative to the root of your YADM repo (which is $HOME for most).
|
||||
|
||||
# yadm_tracked_nonrecursively
|
||||
# Same as above but don't search recursively
|
||||
#
|
||||
# ignore_files_and_dirs
|
||||
# A list of directories and files that will not be reported as untracked if
|
||||
# found in the above two searches.
|
||||
#
|
||||
# Example configuration file (uncomment it to use):
|
||||
# yadm_tracked_recursively=(
|
||||
# bin .config .vim
|
||||
# )
|
||||
#
|
||||
# yadm_tracked_nonrecursively=(
|
||||
# ~
|
||||
# )
|
||||
#
|
||||
# ignore_files_and_dirs=(
|
||||
# .CFUserTextEncoding .DS_Store .config/gh
|
||||
# .vim/autoload/plug.vim
|
||||
# )
|
||||
|
||||
if [[ $# -ne 1 ]]; then
|
||||
echo 'Usage: yadm-untracked <config-file>'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
yadm_tracked_recursively=()
|
||||
yadm_tracked_nonrecursively=()
|
||||
ignore_files_and_dirs=()
|
||||
|
||||
source $1
|
||||
|
||||
root=`yadm enter echo '$GIT_WORK_TREE'`
|
||||
|
||||
cd $root
|
||||
|
||||
find_list=$(mktemp -t find_list)
|
||||
find ${yadm_tracked_recursively[*]} -type f >$find_list
|
||||
find ${yadm_tracked_nonrecursively[*]} -maxdepth 1 -type f |
|
||||
awk "{sub(\"^\./\", \"\"); sub(\"^$root/\", \"\"); print }" >>$find_list
|
||||
sort -o $find_list $find_list
|
||||
|
||||
yadm_list=$(mktemp -t yadm_list)
|
||||
yadm list >$yadm_list
|
||||
find ${ignore_files_and_dirs[*]} -type f >>$yadm_list
|
||||
sort -o $yadm_list $yadm_list
|
||||
|
||||
# Show the files not in `yadm list`
|
||||
comm -23 $find_list $yadm_list
|
||||
|
||||
rm -f $find_list $yadm_list
|
|
@ -315,3 +315,37 @@ def test_template_recording(runner, yadm, cmd_generated):
|
|||
assert run.success
|
||||
assert run.err == ''
|
||||
assert run.out.rstrip() == expected
|
||||
|
||||
|
||||
def test_underscores_in_distro_and_family(runner, yadm):
|
||||
"""Test replacing spaces in distro / distro_family with underscores"""
|
||||
local_distro = 'test distro'
|
||||
local_distro_family = 'test family'
|
||||
filenames = {
|
||||
'filename##distro.test distro': 1004,
|
||||
'filename##distro.test-distro': 0,
|
||||
'filename##distro.test_distro': 1004,
|
||||
'filename##distro_family.test family': 1008,
|
||||
'filename##distro_family.test-family': 0,
|
||||
'filename##distro_family.test_family': 1008,
|
||||
}
|
||||
|
||||
script = f"""
|
||||
YADM_TEST=1 source {yadm}
|
||||
score=0
|
||||
local_distro="{local_distro}"
|
||||
local_distro_family="{local_distro_family}"
|
||||
"""
|
||||
expected = ''
|
||||
for filename in filenames:
|
||||
script += f"""
|
||||
score_file "{filename}"
|
||||
echo "{filename}"
|
||||
echo "$score"
|
||||
"""
|
||||
expected += filename + '\n'
|
||||
expected += str(filenames[filename]) + '\n'
|
||||
run = runner(command=['bash'], inp=script)
|
||||
assert run.success
|
||||
assert run.err == ''
|
||||
assert run.out == expected
|
||||
|
|
8
yadm
8
yadm
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
# yadm - Yet Another Dotfiles Manager
|
||||
# Copyright (C) 2015-2022 Tim Byrne
|
||||
# Copyright (C) 2015-2023 Tim Byrne
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -21,7 +21,7 @@ if [ -z "$BASH_VERSION" ]; then
|
|||
[ "$YADM_TEST" != 1 ] && exec bash "$0" "$@"
|
||||
fi
|
||||
|
||||
VERSION=3.2.1
|
||||
VERSION=3.2.2
|
||||
|
||||
YADM_WORK="$HOME"
|
||||
YADM_DIR=
|
||||
|
@ -204,14 +204,14 @@ function score_file() {
|
|||
return
|
||||
fi
|
||||
elif [[ "$label" =~ ^(d|distro)$ ]]; then
|
||||
if [ "$value" = "$local_distro" ]; then
|
||||
if [ "${value/\ /_}" = "${local_distro/\ /_}" ]; then
|
||||
score=$((score + 4))
|
||||
else
|
||||
score=0
|
||||
return
|
||||
fi
|
||||
elif [[ "$label" =~ ^(f|distro_family)$ ]]; then
|
||||
if [ "$value" = "$local_distro_family" ]; then
|
||||
if [ "${value/\ /_}" = "${local_distro_family/\ /_}" ]; then
|
||||
score=$((score + 8))
|
||||
else
|
||||
score=0
|
||||
|
|
4
yadm.1
4
yadm.1
|
@ -1,5 +1,5 @@
|
|||
.\" vim: set spell so=8:
|
||||
.TH yadm 1 "17 March 2022" "3.2.1"
|
||||
.TH yadm 1 "23 January 2023" "3.2.2"
|
||||
|
||||
.SH NAME
|
||||
|
||||
|
@ -746,7 +746,7 @@ and
|
|||
.BR openssl (1)
|
||||
are supported.
|
||||
gpg is used by default, but openssl can be configured with the
|
||||
.I yadm.cypher
|
||||
.I yadm.cipher
|
||||
configuration.
|
||||
|
||||
To use this feature, a list of patterns must be created and saved as
|
||||
|
|
286
yadm.md
286
yadm.md
|
@ -42,68 +42,68 @@
|
|||
|
||||
|
||||
## DESCRIPTION
|
||||
yadm is a tool for managing a collection of files across multiple com-
|
||||
puters, using a shared Git repository. In addition, yadm provides a
|
||||
feature to select alternate versions of files for particular systems.
|
||||
Lastly, yadm supplies the ability to manage a subset of secure files,
|
||||
yadm is a tool for managing a collection of files across multiple com‐
|
||||
puters, using a shared Git repository. In addition, yadm provides a
|
||||
feature to select alternate versions of files for particular systems.
|
||||
Lastly, yadm supplies the ability to manage a subset of secure files,
|
||||
which are encrypted before they are included in the repository.
|
||||
|
||||
|
||||
## COMMANDS
|
||||
git-command or git-alias
|
||||
Any command not internally handled by yadm is passed through to
|
||||
git(1). Git commands or aliases are invoked with the yadm man-
|
||||
Any command not internally handled by yadm is passed through to
|
||||
git(1). Git commands or aliases are invoked with the yadm man‐
|
||||
aged repository. The working directory for Git commands will be
|
||||
the configured work-tree (usually $HOME).
|
||||
|
||||
Dotfiles are managed by using standard git commands; add, com-
|
||||
Dotfiles are managed by using standard git commands; add, com‐
|
||||
mit, push, pull, etc.
|
||||
|
||||
The config command is not passed directly through. Instead use
|
||||
The config command is not passed directly through. Instead use
|
||||
the gitconfig command (see below).
|
||||
|
||||
alt Create symbolic links and process templates for any managed
|
||||
files matching the naming rules described in the ALTERNATES and
|
||||
TEMPLATES sections. It is usually unnecessary to run this com-
|
||||
mand, as yadm automatically processes alternates by default.
|
||||
This automatic behavior can be disabled by setting the configu-
|
||||
alt Create symbolic links and process templates for any managed
|
||||
files matching the naming rules described in the ALTERNATES and
|
||||
TEMPLATES sections. It is usually unnecessary to run this com‐
|
||||
mand, as yadm automatically processes alternates by default.
|
||||
This automatic behavior can be disabled by setting the configu‐
|
||||
ration yadm.auto-alt to "false".
|
||||
|
||||
bootstrap
|
||||
Execute $HOME/.config/yadm/bootstrap if it exists.
|
||||
|
||||
clone url
|
||||
Clone a remote repository for tracking dotfiles. After the con-
|
||||
tents of the remote repository have been fetched, a "check out"
|
||||
of the remote HEAD branch is attempted. If there are conflict-
|
||||
ing files already present in the work-tree, the local version
|
||||
will be left unmodified and you'll have to review and resolve
|
||||
Clone a remote repository for tracking dotfiles. After the con‐
|
||||
tents of the remote repository have been fetched, a "check out"
|
||||
of the remote HEAD branch is attempted. If there are conflict‐
|
||||
ing files already present in the work-tree, the local version
|
||||
will be left unmodified and you'll have to review and resolve
|
||||
the difference.
|
||||
|
||||
The repository is stored in $HOME/.local/share/yadm/repo.git.
|
||||
The repository is stored in $HOME/.local/share/yadm/repo.git.
|
||||
By default, $HOME will be used as the work-tree, but this can be
|
||||
overridden with the -w option. yadm can be forced to overwrite
|
||||
an existing repository by providing the -f option. If you want
|
||||
to use a branch other than the remote HEAD branch you can spec-
|
||||
ify it using the -b option. By default yadm will ask the user
|
||||
if the bootstrap program should be run (if it exists). The
|
||||
options --bootstrap or --no-bootstrap will either force the
|
||||
bootstrap to be run, or prevent it from being run, without
|
||||
prompting the user.
|
||||
overridden with the -w option. yadm can be forced to overwrite
|
||||
an existing repository by providing the -f option. If you want
|
||||
to use a branch other than the remote HEAD branch you can spec‐
|
||||
ify it using the -b option. By default yadm will ask the user
|
||||
if the bootstrap program should be run (if it exists). The op‐
|
||||
tions --bootstrap or --no-bootstrap will either force the boot‐
|
||||
strap to be run, or prevent it from being run, without prompting
|
||||
the user.
|
||||
|
||||
config This command manages configurations for yadm. This command
|
||||
config This command manages configurations for yadm. This command
|
||||
works exactly the way git-config(1) does. See the CONFIGURATION
|
||||
section for more details.
|
||||
|
||||
decrypt
|
||||
Decrypt all files stored in $HOME/.local/share/yadm/archive.
|
||||
Files decrypted will be relative to the configured work-tree
|
||||
Decrypt all files stored in $HOME/.local/share/yadm/archive.
|
||||
Files decrypted will be relative to the configured work-tree
|
||||
(usually $HOME). Using the -l option will list the files stored
|
||||
without extracting them.
|
||||
|
||||
encrypt
|
||||
Encrypt all files matching the patterns found in $HOME/.con-
|
||||
fig/yadm/encrypt. See the ENCRYPTION section for more details.
|
||||
Encrypt all files matching the patterns found in $HOME/.con‐
|
||||
fig/yadm/encrypt. See the ENCRYPTION section for more details.
|
||||
|
||||
enter Run a sub-shell with all Git variables set. Exit the sub-shell
|
||||
the same way you leave your normal shell (usually with the
|
||||
|
@ -116,7 +116,7 @@
|
|||
of invoking your shell, that command will be run with all of the
|
||||
Git variables exposed to the command's environment.
|
||||
|
||||
Emacs Tramp and Magit can manage files by using this configura-
|
||||
Emacs Tramp and Magit can manage files by using this configura‐
|
||||
tion:
|
||||
|
||||
(add-to-list 'tramp-methods
|
||||
|
@ -130,9 +130,9 @@
|
|||
With this config, use (magit-status "/yadm::").
|
||||
|
||||
git-crypt options
|
||||
If git-crypt is installed, this command allows you to pass
|
||||
options directly to git-crypt, with the environment configured
|
||||
to use the yadm repository.
|
||||
If git-crypt is installed, this command allows you to pass op‐
|
||||
tions directly to git-crypt, with the environment configured to
|
||||
use the yadm repository.
|
||||
|
||||
git-crypt enables transparent encryption and decryption of files
|
||||
in a git repository. You can read https://github.com/AGWA/git-
|
||||
|
@ -140,13 +140,13 @@
|
|||
|
||||
gitconfig
|
||||
Pass options to the git config command. Since yadm already uses
|
||||
the config command to manage its own configurations, this com-
|
||||
mand is provided as a way to change configurations of the repos-
|
||||
the config command to manage its own configurations, this com‐
|
||||
mand is provided as a way to change configurations of the repos‐
|
||||
itory managed by yadm. One useful case might be to configure
|
||||
the repository so untracked files are shown in status commands.
|
||||
yadm initially configures its repository so that untracked files
|
||||
are not shown. If you wish use the default Git behavior (to
|
||||
show untracked files and directories), you can remove this con-
|
||||
show untracked files and directories), you can remove this con‐
|
||||
figuration.
|
||||
|
||||
yadm gitconfig --unset status.showUntrackedFiles
|
||||
|
@ -169,15 +169,15 @@
|
|||
support command line completion.
|
||||
|
||||
perms Update permissions as described in the PERMISSIONS section. It
|
||||
is usually unnecessary to run this command, as yadm automati-
|
||||
is usually unnecessary to run this command, as yadm automati‐
|
||||
cally processes permissions by default. This automatic behavior
|
||||
can be disabled by setting the configuration yadm.auto-perms to
|
||||
"false".
|
||||
|
||||
transcrypt options
|
||||
If transcrypt is installed, this command allows you to pass
|
||||
options directly to transcrypt, with the environment configured
|
||||
to use the yadm repository.
|
||||
If transcrypt is installed, this command allows you to pass op‐
|
||||
tions directly to transcrypt, with the environment configured to
|
||||
use the yadm repository.
|
||||
|
||||
transcrypt enables transparent encryption and decryption of
|
||||
files in a git repository. You can read
|
||||
|
@ -186,7 +186,7 @@
|
|||
upgrade
|
||||
Version 3 of yadm uses a different directory for storing data.
|
||||
When you start to use version 3 for the first time, you may see
|
||||
warnings about moving your data to this new directory. The eas-
|
||||
warnings about moving your data to this new directory. The eas‐
|
||||
iest way to accomplish this is by running "yadm upgrade". This
|
||||
command will start by moving your yadm repo to the new path.
|
||||
Next it will move any archive data. If the archive is tracked
|
||||
|
@ -194,18 +194,18 @@
|
|||
that file in the repo's index.
|
||||
|
||||
Upgrading will attempt to de-initialize and re-initialize your
|
||||
submodules. If your submodules cannot be de-initialized, the
|
||||
upgrade will fail. The most common reason submodules will fail
|
||||
to de-initialize is because they have local modifications. If
|
||||
you are willing to lose the local modifications to those submod-
|
||||
ules, you can use the -f option with the "upgrade" command to
|
||||
force the de-initialization.
|
||||
submodules. If your submodules cannot be de-initialized, the up‐
|
||||
grade will fail. The most common reason submodules will fail to
|
||||
de-initialize is because they have local modifications. If you
|
||||
are willing to lose the local modifications to those submodules,
|
||||
you can use the -f option with the "upgrade" command to force
|
||||
the de-initialization.
|
||||
|
||||
After running "yadm upgrade", you should run "yadm status" to
|
||||
review changes which have been staged, and commit them to your
|
||||
repository.
|
||||
|
||||
You can read https://yadm.io/docs/upgrade_from_2 for more infor-
|
||||
You can read https://yadm.io/docs/upgrade_from_2 for more infor‐
|
||||
mation.
|
||||
|
||||
version
|
||||
|
@ -214,7 +214,7 @@
|
|||
|
||||
## OPTIONS
|
||||
yadm supports a set of universal options that alter the paths it uses.
|
||||
The default paths are documented in the FILES section. Any path speci-
|
||||
The default paths are documented in the FILES section. Any path speci‐
|
||||
fied by these options must be fully qualified. If you always want to
|
||||
override one or more of these paths, it may be useful to create an
|
||||
alias for the yadm command. For example, the following alias could be
|
||||
|
@ -261,24 +261,24 @@
|
|||
The following is the full list of supported configurations:
|
||||
|
||||
yadm.alt-copy
|
||||
If set to "true", alternate files will be copies instead of sym-
|
||||
If set to "true", alternate files will be copies instead of sym‐
|
||||
bolic links. This might be desirable, because some systems may
|
||||
not properly support symlinks.
|
||||
|
||||
yadm.auto-alt
|
||||
Disable the automatic linking described in the section ALTER-
|
||||
Disable the automatic linking described in the section ALTER‐
|
||||
NATES. If disabled, you may still run "yadm alt" manually to
|
||||
create the alternate links. This feature is enabled by default.
|
||||
create the alternate links. This feature is enabled by default.
|
||||
|
||||
yadm.auto-exclude
|
||||
Disable the automatic exclusion of patterns defined in
|
||||
Disable the automatic exclusion of patterns defined in
|
||||
$HOME/.config/yadm/encrypt. This feature is enabled by default.
|
||||
|
||||
yadm.auto-perms
|
||||
Disable the automatic permission changes described in the sec-
|
||||
Disable the automatic permission changes described in the sec‐
|
||||
tion PERMISSIONS. If disabled, you may still run yadm perms
|
||||
manually to update permissions. This feature is enabled by
|
||||
default.
|
||||
manually to update permissions. This feature is enabled by de‐
|
||||
fault.
|
||||
|
||||
yadm.auto-private-dirs
|
||||
Disable the automatic creating of private directories described
|
||||
|
@ -287,20 +287,20 @@
|
|||
yadm.cipher
|
||||
Configure which encryption system is used by the encrypt/decrypt
|
||||
commands. Valid options are "gpg" and "openssl". The default is
|
||||
"gpg". Detailed information can be found in the section ENCRYP-
|
||||
"gpg". Detailed information can be found in the section ENCRYP‐
|
||||
TION.
|
||||
|
||||
yadm.git-program
|
||||
Specify an alternate program to use instead of "git". By
|
||||
default, the first "git" found in $PATH is used.
|
||||
Specify an alternate program to use instead of "git". By de‐
|
||||
fault, the first "git" found in $PATH is used.
|
||||
|
||||
yadm.gpg-perms
|
||||
Disable the permission changes to $HOME/.gnupg/*. This feature
|
||||
is enabled by default.
|
||||
|
||||
yadm.gpg-program
|
||||
Specify an alternate program to use instead of "gpg". By
|
||||
default, the first "gpg" found in $PATH is used.
|
||||
Specify an alternate program to use instead of "gpg". By de‐
|
||||
fault, the first "gpg" found in $PATH is used.
|
||||
|
||||
yadm.gpg-recipient
|
||||
Asymmetrically encrypt files with a gpg public/private key pair.
|
||||
|
@ -308,9 +308,9 @@
|
|||
The key must exist in your public keyrings. Multiple recipients
|
||||
can be specified (separated by space). If left blank or not
|
||||
provided, symmetric encryption is used instead. If set to
|
||||
"ASK", gpg will interactively ask for recipients. See the
|
||||
ENCRYPTION section for more details. This feature is disabled
|
||||
by default.
|
||||
"ASK", gpg will interactively ask for recipients. See the EN‐
|
||||
CRYPTION section for more details. This feature is disabled by
|
||||
default.
|
||||
|
||||
yadm.openssl-ciphername
|
||||
Specify which cipher should be used by openssl. "aes-256-cbc"
|
||||
|
@ -337,13 +337,13 @@
|
|||
|
||||
local.class
|
||||
Specify a class for the purpose of symlinking alternate files.
|
||||
By default, no class will be matched. The local host can be
|
||||
assigned multiple classes using command:
|
||||
By default, no class will be matched. The local host can be as‐
|
||||
signed multiple classes using command:
|
||||
|
||||
yadm config --add local.class <additional-class>
|
||||
|
||||
local.arch
|
||||
Override the architecture for the purpose of symlinking alter-
|
||||
Override the architecture for the purpose of symlinking alter‐
|
||||
nate files.
|
||||
|
||||
local.hostname
|
||||
|
@ -362,53 +362,53 @@
|
|||
to have an automated way of choosing an alternate version of a file for
|
||||
a different operating system, host, user, etc.
|
||||
|
||||
yadm will automatically create a symbolic link to the appropriate ver-
|
||||
sion of a file, when a valid suffix is appended to the filename. The
|
||||
suffix contains the conditions that must be met for that file to be
|
||||
yadm will automatically create a symbolic link to the appropriate ver‐
|
||||
sion of a file, when a valid suffix is appended to the filename. The
|
||||
suffix contains the conditions that must be met for that file to be
|
||||
used.
|
||||
|
||||
The suffix begins with "##", followed by any number of conditions sepa-
|
||||
The suffix begins with "##", followed by any number of conditions sepa‐
|
||||
rated by commas.
|
||||
|
||||
##<condition>[,<condition>,...]
|
||||
|
||||
Each condition is an attribute/value pair, separated by a period. Some
|
||||
conditions do not require a "value", and in that case, the period and
|
||||
value can be omitted. Most attributes can be abbreviated as a single
|
||||
Each condition is an attribute/value pair, separated by a period. Some
|
||||
conditions do not require a "value", and in that case, the period and
|
||||
value can be omitted. Most attributes can be abbreviated as a single
|
||||
letter.
|
||||
|
||||
<attribute>[.<value>]
|
||||
|
||||
These are the supported attributes, in the order of the weighted prece-
|
||||
These are the supported attributes, in the order of the weighted prece‐
|
||||
dence:
|
||||
|
||||
|
||||
template, t
|
||||
Valid when the value matches a supported template processor.
|
||||
Valid when the value matches a supported template processor.
|
||||
See the TEMPLATES section for more details.
|
||||
|
||||
user, u
|
||||
Valid if the value matches the current user. Current user is
|
||||
Valid if the value matches the current user. Current user is
|
||||
calculated by running id -u -n.
|
||||
|
||||
hostname, h
|
||||
Valid if the value matches the short hostname. Hostname is cal-
|
||||
Valid if the value matches the short hostname. Hostname is cal‐
|
||||
culated by running uname -n, and trimming off any domain.
|
||||
|
||||
class, c
|
||||
Valid if the value matches the local.class configuration. Class
|
||||
must be manually set using yadm config local.class <class>. See
|
||||
the CONFIGURATION section for more details about setting
|
||||
local.class.
|
||||
the CONFIGURATION section for more details about setting lo‐
|
||||
cal.class.
|
||||
|
||||
distro, d
|
||||
Valid if the value matches the distro. Distro is calculated by
|
||||
running lsb_release -si or by inspecting the ID from /etc/os-
|
||||
release.
|
||||
Valid if the value matches the distro. Distro is calculated by
|
||||
running lsb_release -si or by inspecting the ID from /etc/os-re‐
|
||||
lease.
|
||||
|
||||
distro_family, f
|
||||
Valid if the value matches the distro family. Distro family is
|
||||
calculated by inspecting the ID_LIKE line from /etc/os-release.
|
||||
Valid if the value matches the distro family. Distro family is
|
||||
calculated by inspecting the ID_LIKE line from /etc/os-release.
|
||||
|
||||
os, o Valid if the value matches the OS. OS is calculated by running
|
||||
uname -s.
|
||||
|
@ -426,7 +426,6 @@
|
|||
certain extension to e.g. make editors highlight the content
|
||||
properly.
|
||||
|
||||
|
||||
NOTE: The OS for "Windows Subsystem for Linux" is reported as "WSL",
|
||||
even though uname identifies as "Linux".
|
||||
|
||||
|
@ -439,15 +438,15 @@
|
|||
The "most appropriate" version is determined by calculating a score for
|
||||
each version of a file. A template is always scored higher than any
|
||||
symlink condition. The number of conditions is the next largest factor
|
||||
in scoring. Files with more conditions will always be favored. Any
|
||||
invalid condition will disqualify that file completely.
|
||||
in scoring. Files with more conditions will always be favored. Any in‐
|
||||
valid condition will disqualify that file completely.
|
||||
|
||||
If you don't care to have all versions of alternates stored in the same
|
||||
directory as the generated symlink, you can place them in the
|
||||
$HOME/.config/yadm/alt directory. The generated symlink or processed
|
||||
template will be created using the same relative path.
|
||||
|
||||
Alternate linking may best be demonstrated by example. Assume the fol-
|
||||
Alternate linking may best be demonstrated by example. Assume the fol‐
|
||||
lowing files are managed by yadm's repository:
|
||||
|
||||
- $HOME/path/example.txt##default
|
||||
|
@ -462,7 +461,7 @@
|
|||
If running on a Macbook named "host2", yadm will create a symbolic link
|
||||
which looks like this:
|
||||
|
||||
$HOME/path/example.txt -> $HOME/path/example.txt##os.Darwin,host-
|
||||
$HOME/path/example.txt -> $HOME/path/example.txt##os.Darwin,host‐
|
||||
name.host2
|
||||
|
||||
However, on another Mackbook named "host3", yadm will create a symbolic
|
||||
|
@ -491,7 +490,7 @@
|
|||
Links are also created for directories named this way, as long as they
|
||||
have at least one yadm managed file within them (at the top level).
|
||||
|
||||
yadm will automatically create these links by default. This can be dis-
|
||||
yadm will automatically create these links by default. This can be dis‐
|
||||
abled using the yadm.auto-alt configuration. Even if disabled, links
|
||||
can be manually created by running yadm alt.
|
||||
|
||||
|
@ -504,8 +503,8 @@
|
|||
yadm config local.class Work
|
||||
|
||||
Similarly, the values of architecture, os, hostname, and user can be
|
||||
manually overridden using the configuration options local.arch,
|
||||
local.os, local.hostname, and local.user.
|
||||
manually overridden using the configuration options local.arch, lo‐
|
||||
cal.os, local.hostname, and local.user.
|
||||
|
||||
|
||||
## TEMPLATES
|
||||
|
@ -517,7 +516,7 @@
|
|||
|
||||
default
|
||||
This is yadm's built-in template processor. This processor is
|
||||
very basic, with a Jinja-like syntax. The advantage of this pro-
|
||||
very basic, with a Jinja-like syntax. The advantage of this pro‐
|
||||
cessor is that it only depends upon awk, which is available on
|
||||
most *nix systems. To use this processor, specify the value of
|
||||
"default" or just leave the value off (e.g. "##template").
|
||||
|
@ -537,14 +536,13 @@
|
|||
envtpl To use the envtpl Jinja template processor, specify the value of
|
||||
"j2" or "envtpl".
|
||||
|
||||
|
||||
NOTE: Specifying "j2" as the processor will attempt to use j2cli or
|
||||
envtpl, whichever is available.
|
||||
NOTE: Specifying "j2" as the processor will attempt to use j2cli or en‐
|
||||
vtpl, whichever is available.
|
||||
|
||||
If the template processor specified is available, templates will be
|
||||
processed to create or overwrite files.
|
||||
|
||||
During processing, the following variables are available in the tem-
|
||||
During processing, the following variables are available in the tem‐
|
||||
plate:
|
||||
|
||||
Default Jinja or ESH Description
|
||||
|
@ -616,7 +614,7 @@
|
|||
version can be maintained in the Git repository. This feature will
|
||||
only work if a supported tool is available. Both gpg(1) and openssl(1)
|
||||
are supported. gpg is used by default, but openssl can be configured
|
||||
with the yadm.cypher configuration.
|
||||
with the yadm.cipher configuration.
|
||||
|
||||
To use this feature, a list of patterns must be created and saved as
|
||||
$HOME/.config/yadm/encrypt. This list of patterns should be relative
|
||||
|
@ -635,7 +633,7 @@
|
|||
The yadm encrypt command will find all files matching the patterns, and
|
||||
prompt for a password. Once a password has confirmed, the matching
|
||||
files will be encrypted and saved as $HOME/.local/share/yadm/archive.
|
||||
The "encrypt" and "archive" files should be added to the yadm reposi-
|
||||
The "encrypt" and "archive" files should be added to the yadm reposi‐
|
||||
tory so they are available across multiple systems.
|
||||
|
||||
To decrypt these files later, or on another system run yadm decrypt and
|
||||
|
@ -650,27 +648,25 @@
|
|||
|
||||
Patterns found in $HOME/.config/yadm/encrypt are automatically added to
|
||||
the repository's info/exclude file every time yadm encrypt is run.
|
||||
This is to prevent accidentally committing sensitive data to the repos-
|
||||
This is to prevent accidentally committing sensitive data to the repos‐
|
||||
itory. This can be disabled using the yadm.auto-exclude configuration.
|
||||
|
||||
Using transcrypt or git-crypt
|
||||
|
||||
A completely separate option for encrypting data is to install and use
|
||||
transcrypt or git-crypt. Once installed, you can use these tools by
|
||||
running yadm transcrypt or yadm git-crypt. These tools enables trans-
|
||||
parent encryption and decryption of files in a git repository. See the
|
||||
A completely separate option for encrypting data is to install and use
|
||||
transcrypt or git-crypt. Once installed, you can use these tools by
|
||||
running yadm transcrypt or yadm git-crypt. These tools enables trans‐
|
||||
parent encryption and decryption of files in a git repository. See the
|
||||
following web sites for more information:
|
||||
|
||||
- https://github.com/elasticdog/transcrypt
|
||||
|
||||
- https://github.com/AGWA/git-crypt
|
||||
|
||||
|
||||
|
||||
## PERMISSIONS
|
||||
When files are checked out of a Git repository, their initial permis-
|
||||
sions are dependent upon the user's umask. Because of this, yadm will
|
||||
automatically update the permissions of some file paths. The "group"
|
||||
When files are checked out of a Git repository, their initial permis‐
|
||||
sions are dependent upon the user's umask. Because of this, yadm will
|
||||
automatically update the permissions of some file paths. The "group"
|
||||
and "others" permissions will be removed from the following files:
|
||||
|
||||
- $HOME/.local/share/yadm/archive
|
||||
|
@ -681,40 +677,40 @@
|
|||
|
||||
- The GPG directory and files, .gnupg/*
|
||||
|
||||
yadm will automatically update permissions by default. This can be dis-
|
||||
abled using the yadm.auto-perms configuration. Even if disabled, per-
|
||||
missions can be manually updated by running yadm perms. The .ssh
|
||||
directory processing can be disabled using the yadm.ssh-perms configu-
|
||||
ration. The .gnupg directory processing can be disabled using the
|
||||
yadm will automatically update permissions by default. This can be dis‐
|
||||
abled using the yadm.auto-perms configuration. Even if disabled, per‐
|
||||
missions can be manually updated by running yadm perms. The .ssh di‐
|
||||
rectory processing can be disabled using the yadm.ssh-perms configura‐
|
||||
tion. The .gnupg directory processing can be disabled using the
|
||||
yadm.gpg-perms configuration.
|
||||
|
||||
When cloning a repo which includes data in a .ssh or .gnupg directory,
|
||||
if those directories do not exist at the time of cloning, yadm will
|
||||
When cloning a repo which includes data in a .ssh or .gnupg directory,
|
||||
if those directories do not exist at the time of cloning, yadm will
|
||||
create the directories with mask 0700 prior to merging the fetched data
|
||||
into the work-tree.
|
||||
|
||||
When running a Git command and .ssh or .gnupg directories do not exist,
|
||||
yadm will create those directories with mask 0700 prior to running the
|
||||
Git command. This can be disabled using the yadm.auto-private-dirs con-
|
||||
yadm will create those directories with mask 0700 prior to running the
|
||||
Git command. This can be disabled using the yadm.auto-private-dirs con‐
|
||||
figuration.
|
||||
|
||||
|
||||
## HOOKS
|
||||
For every command yadm supports, a program can be provided to run
|
||||
before or after that command. These are referred to as "hooks". yadm
|
||||
looks for hooks in the directory $HOME/.config/yadm/hooks. Each hook
|
||||
For every command yadm supports, a program can be provided to run be‐
|
||||
fore or after that command. These are referred to as "hooks". yadm
|
||||
looks for hooks in the directory $HOME/.config/yadm/hooks. Each hook
|
||||
is named using a prefix of pre_ or post_, followed by the command which
|
||||
should trigger the hook. For example, to create a hook which is run
|
||||
after every yadm pull command, create a hook named post_pull. Hooks
|
||||
must have the executable file permission set.
|
||||
should trigger the hook. For example, to create a hook which is run af‐
|
||||
ter every yadm pull command, create a hook named post_pull. Hooks must
|
||||
have the executable file permission set.
|
||||
|
||||
If a pre_ hook is defined, and the hook terminates with a non-zero exit
|
||||
status, yadm will refuse to run the yadm command. For example, if a
|
||||
pre_commit hook is defined, but that command ends with a non-zero exit
|
||||
status, the yadm commit will never be run. This allows one to "short-
|
||||
status, yadm will refuse to run the yadm command. For example, if a
|
||||
pre_commit hook is defined, but that command ends with a non-zero exit
|
||||
status, the yadm commit will never be run. This allows one to "short-
|
||||
circuit" any operation using a pre_ hook.
|
||||
|
||||
Hooks have the following environment variables available to them at
|
||||
Hooks have the following environment variables available to them at
|
||||
runtime:
|
||||
|
||||
YADM_HOOK_COMMAND
|
||||
|
@ -736,37 +732,37 @@
|
|||
|
||||
|
||||
## FILES
|
||||
All of yadm's configurations are relative to the "yadm directory".
|
||||
yadm uses the "XDG Base Directory Specification" to determine this
|
||||
directory. If the environment variable $XDG_CONFIG_HOME is defined as
|
||||
a fully qualified path, this directory will be $XDG_CONFIG_HOME/yadm.
|
||||
All of yadm's configurations are relative to the "yadm directory".
|
||||
yadm uses the "XDG Base Directory Specification" to determine this di‐
|
||||
rectory. If the environment variable $XDG_CONFIG_HOME is defined as a
|
||||
fully qualified path, this directory will be $XDG_CONFIG_HOME/yadm.
|
||||
Otherwise it will be $HOME/.config/yadm.
|
||||
|
||||
Similarly, yadm's data files are relative to the "yadm data directory".
|
||||
yadm uses the "XDG Base Directory Specification" to determine this
|
||||
directory. If the environment variable $XDG_DATA_HOME is defined as a
|
||||
fully qualified path, this directory will be $XDG_DATA_HOME/yadm. Oth-
|
||||
yadm uses the "XDG Base Directory Specification" to determine this di‐
|
||||
rectory. If the environment variable $XDG_DATA_HOME is defined as a
|
||||
fully qualified path, this directory will be $XDG_DATA_HOME/yadm. Oth‐
|
||||
erwise it will be $HOME/.local/share/yadm.
|
||||
|
||||
The following are the default paths yadm uses for its own data. Most
|
||||
The following are the default paths yadm uses for its own data. Most
|
||||
of these paths can be altered using universal options. See the OPTIONS
|
||||
section for details.
|
||||
|
||||
$HOME/.config/yadm
|
||||
The yadm directory. By default, all configs yadm stores is rela-
|
||||
The yadm directory. By default, all configs yadm stores is rela‐
|
||||
tive to this directory.
|
||||
|
||||
$HOME/.local/share/yadm
|
||||
The yadm data directory. By default, all data yadm stores is
|
||||
The yadm data directory. By default, all data yadm stores is
|
||||
relative to this directory.
|
||||
|
||||
$YADM_DIR/config
|
||||
Configuration file for yadm.
|
||||
|
||||
$YADM_DIR/alt
|
||||
This is a directory to keep "alternate files" without having
|
||||
them side-by-side with the resulting symlink or processed tem-
|
||||
plate. Alternate files placed in this directory will be created
|
||||
This is a directory to keep "alternate files" without having
|
||||
them side-by-side with the resulting symlink or processed tem‐
|
||||
plate. Alternate files placed in this directory will be created
|
||||
relative to $HOME instead.
|
||||
|
||||
$YADM_DATA/repo.git
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
|
||||
Name: yadm
|
||||
Summary: Yet Another Dotfiles Manager
|
||||
Version: 3.2.1
|
||||
Version: 3.2.2
|
||||
Group: Development/Tools
|
||||
Release: 1%{?dist}
|
||||
URL: https://yadm.io
|
||||
|
|
Loading…
Reference in a new issue