1
0
Fork 0
mirror of synced 2025-04-30 01:59:41 -04:00
Commit graph

722 commits

Author SHA1 Message Date
Erik Flodin
7eabaee84c
Release 3.5.0
* Silence warnings when collecting alt files (#521)
  * Adjust handling of encrypt patterns to match 3.3.0 and older
  * Make encrypt exclude patterns only match encrypted files
  * Automatically exclude alt and template files (#234)
  * Support negative alt conditions (#365)
  * Handle filenames with space in bash completion (#341)
  * Add new yadm.filename template variable (#520)
2025-03-04 00:05:35 +01:00
Erik Flodin
4f4c5e2914
Update CHANGES and prepare for 3.5.0 2025-03-04 00:03:44 +01:00
Erik Flodin
0e0172769d
Add yadm.filename variable to default template processor
Similar to yadm.source but reflects the current file also in included
files (#520).
2025-03-03 23:47:16 +01:00
Erik Flodin
2ac90b004c
Fix handling of filenames with space in bash completion (#341)
By calling __gitcompappend with the same suffix as the completion for git
does (i.e. " ") we can remove the call to sort -u as it is no longer
needed (bash seems to remove duplicates) and then spaces are handled correctly.

Also make the completion available in testhost.
2025-03-03 21:36:36 +01:00
Erik Flodin
bee1558a4e
Minor cleanups of alt handling
Also correct alt conditions precedence list in manual.
2025-03-02 22:18:09 +01:00
AaronYoung5
9ff5e09650
Add support for negative alt conditions (#522) 2025-03-02 22:06:12 +01:00
Erik Flodin
d4796108f4
Automatically exclude alt links and template files
unless yadm.auto-exclude is set to false (#234, #465).

Alt files exclude pattern will be written to $GIT_DIR/info/exclude.yadm-alt and
encrypt files exclude patthern to ...yadm-encrypt. Then these two files will be
merged together and added to $GIT_DIR/info/exclude whenever one of them has
changed.
2025-03-02 21:05:43 +01:00
Erik Flodin
6726730701
parse_encrypt: Don't let e.g. "*.ext" match files in subdirs
This matches the behavior before 3.4.0.

Silent errors from ls-files to avoid warnings about e.g. directories that
aren't readable and also list files that would have been encrypted had they not
been tracked in git (#521).

Fix the patterns written to info/exclude so that they match the same files as
are encrypted (e.g. *.key should only match .key files in the topdir, not in
subdirs).
2025-02-25 23:04:23 +01:00
Erik Flodin
5648f8b337
Release 3.4.0
* Improve and harden alt file regeneration (#466)
* Fix "yadm config" in fish completion (#491)
* Fix "yadm clone" when not run in "$YADM_WORK" (#513)
* Output the actual paths in help message (#376)
* Verify all alt conditions for templates (#478)
* Ignore case in alt and default template conditions (#455, #456)
* Fall back to ID for distro family if ID_LIKE is not available (#494)
* Support overriding distro and distro family (#430)
* Improve support for Bash 3 (the default version on macOS)
* Make "yadm clone --recursive" work as expected (#517)
* Don't include files multiple times in archive (#125)
* Document YADM_HOOK_DATA and YADM_HOOK_DIR env variables (#343)
* Support alt dirs with deeply nested tracked files (#495)
2025-02-09 22:28:48 +01:00
Erik Flodin
c90aa86051
Update CHANGES and prepare for 3.4.0 2025-02-09 22:24:18 +01:00
Erik Flodin
7e19d21f09
Document YADM_HOOK_DATA and YADM_HOOK_DIR env variables (#343) 2025-01-27 22:25:03 +01:00
Erik Flodin
1505b7ec8f
Add test to verify that file is only included once in archive
As of the switch (in 4511f5d9) to use git ls-files to list files to include in
archive, duplicate matches are automatically removed (fixes #125).
2025-01-27 21:54:10 +01:00
Erik Flodin
02b4019bc6
Add support and tests for clone --recurse-submodules
Including tests for clone --recursive.
2025-01-20 00:01:22 +01:00
Christof Warlich
a86f2381b6
Make "yadm clone --recursive" work as expected (#517)
The --recursive switch was ignored when YADM clones a dotfile repository.
This commit causes "yadm clone --recursive" to also clone submodules
in one go, similar to what GIT does when given the --recursive switch.
2025-01-14 22:45:50 +01:00
Erik Flodin
f33e7c2e1f
Run tests on github windows runner using WSL 2025-01-09 22:15:22 +01:00
Erik Flodin
0f5ee86b38
test: Make distroy family detection work as in yadm
So that family is properly set also on e.g. debian.
2025-01-09 22:08:50 +01:00
Christof Warlich
1e5612d707
Fix testing with WSL (#516) 2025-01-09 21:46:58 +01:00
Erik Flodin
1d69ce370c
Merge pull request #491 2024-12-15 17:25:27 +01:00
Erik Flodin
119d1ddbaa
Refactor template handling
Move common template logic out to a new template() function that calls one of
the existing template processors and then handles writing the result and
copying permissions.
2024-12-15 16:15:14 +01:00
Erik Flodin
eb819782ee
Merge pull request #466 from rasa/improve-template-logic 2024-12-15 16:14:50 +01:00
Ross Smith II
7a4de1a247
Always remove temp_file on failure, other cleanup 2024-12-15 16:13:25 +01:00
Erik Flodin
f5dfc7ab01
Format yadm and bootstrap with shfmt
Command: shfmt -w -ln bash -i 2 -ci <file>
2024-12-11 20:07:38 +01:00
Erik Flodin
bb21c9a267
Run tests directly on github runner instead of in the docker image
As this makes it possible to run the tests on different systems. Initially
ubuntu (20.04 and 24.04) and macOs (13 and 15).
2024-12-10 21:51:58 +01:00
Erik Flodin
4511f5d9c6
Use git ls-files to list files to encrypt
By using git ls-files instead of bash we can support ** also on macOS where the
included bash version (3) doesn't support globstar.
2024-12-10 21:51:58 +01:00
Erik Flodin
216d49ceef
Run mandoc or groff instead of man.REAL to check man page
Also fix all warnings reported by mandoc and apply some of the recommendations
from https://liw.fi/manpages/.
2024-12-10 21:29:27 +01:00
Erik Flodin
24772e7b4b
Fix test_upgrade when running outside of docker image
E.g. direct on github runner.
2024-12-10 21:28:51 +01:00
Erik Flodin
3093460d41
Ignore __pycache__/ 2024-12-10 21:28:51 +01:00
Erik Flodin
c232894792
Make test_unit_configure_paths work with bash 3
Bash 3 doesn't understand declare -p so use regular parameter expansion instead
to print all variables that begin with YADM_ or GIT_.
2024-12-10 21:28:50 +01:00
Erik Flodin
8c2f833b43
Support overriding distro and distro family
Fixes #430.
2024-12-10 18:35:26 +01:00
Erik Flodin
c092b7c099
Ignore case in alt and default template processor conditions
This aligns all conditions with distro and distro_family.

Suggestion from #456.
2024-12-09 23:50:49 +01:00
Erik Flodin
6c1970fb41
Set distro family from ID line if no ID_LIKE line is found
See #456.
2024-12-09 23:13:43 +01:00
Erik Flodin
18d5f66542
Ignore case for yadm.distro and .distro_family in default template
Same as b2b0b14 but for if statements in default template processor.
2024-12-09 22:54:41 +01:00
Erik Flodin
b2b0b143d6
Refactor alt handling
* Simplify score_file() by using case in instead of nested ifs with regexps.
* Merge record_score() and record_template().
* Alt condition processing no longer stops when a template condition is seen
  but continues processing to verify that all conditions are valid (as the
  documentation says it should). Fixes #478.
* Support alt dirs with deeply nested tracked files (fixes #490).
* Use git ls-files to filter out which tracked files to consider for alt
  processing. Should speed up auto-alt (#505).
* Use nocasematch when comparing distro and distro_family. Fixed #455.
2024-12-06 23:10:52 +01:00
Erik Flodin
b164d03594
Make relative_path match full dir and not just a prefix
Before this change, relative_path "/A/B/C" "/A/B/CD" would return "" instead of
the correct "../CD".
2024-12-06 23:10:49 +01:00
Erik Flodin
0b91140ea8
Output the actual paths in help message
Fixes #376.
2024-12-06 00:07:45 +01:00
Erik Flodin
6ee9b472d1
Merge pull request #507 from AVM-Martin/fix/reset-yadm-work-index
fix(clone): reset index of YADM_WORK
2024-11-29 23:10:35 +01:00
AVM.Martin
ae3a149449
style: use pathspec for consistency 2024-11-26 19:22:18 +07:00
AVM.Martin
85e8c1ddfc
docs: fix comment 2024-11-26 19:21:18 +07:00
AVM.Martin
a7939bec7b
style: join arguments 2024-11-26 19:20:59 +07:00
Erik Flodin
ec10041024
Call bootstrap scripts with a tty
Inspired by #449 but using read instead of mapfile to make it work with bash
3. Fixes #344.
2024-11-24 20:18:22 +01:00
Erik Flodin
3a1b236147
Link features in README.md to yadm.io (as suggested in #346) 2024-11-24 17:03:56 +01:00
Erik Flodin
30fa6f08a4
Update testbed docker image
* Update base image to Ubuntu 24.10. This uses a python version where j2cli no
  longer works when installed using pip so use the version from Ubuntu instead
  which has been patched to work.

* Update shellcheck, pylint, pytest, isort, flake8, black and yamllint to the
  latest versions. This closes #502.

* Use a longer expect timeout to fix tests failing when gpg is killed due to
  this timeout.

* Explicitly flush gpg-agent's cached passwords to fix failing tests with
  latest gnupg. Also clean up after tests to avoid having gpg-agents running
  after the test (e.g. when running tests directly without docker).
2024-11-11 22:30:41 +01:00
Erik Flodin
640b324401
Prepare for version 3.3.0
* Support nested ifs in default template (#436)
 * Support include and ifs in default template includes (#406)
 * Support environment variables in ifs in default template (#488)
 * Support != in default template (#358, #477)
 * Fix multiple classes in default template on macOS (#437)
2024-11-08 20:23:23 +01:00
Erik Flodin
8e5d4b1578
Pass classes as separate arguments to template_default
To work around problem with passing newlines in variable with awk on
darwin. This fixes #437.
2024-11-08 19:54:14 +01:00
Erik Flodin
d74a41b1b4
Merge pull request #497 from erijo/template-default
Rewrite default template to handle nested ifs, != and env vars in if
2024-11-06 22:25:40 +01:00
Erik Flodin
144f35b82d
Update links under .github/ to point to new github org 2024-11-04 23:12:28 +01:00
Erik Flodin
8ba9823407
Rewrite default template to handle nested ifs, != and env vars in if
The awk script now performs all processing in the BEGIN block using an
implementation that is capable of handling if statements which contain nested
if statments (fixes #436). To make nested ifs look better, if, else and endif
lines can now have optional whitespace before {%.

Includes are now handled in the same way as the main file which means that
included files can both include other files and have if statements in addition
to variables (fixes #406). Include lines can now also have optional whitespace
before {%.

All variables are handled in the same way now so it's now possible to use env
variables in if statements (fixes #488).

Also add support for != in addition to == (fixes #358). Thus it's now
e.g. possible to check if a variable is set (#477) by doing:

{% if yadm.class != ""%}
Class is set to {{ yadm.class }}
{% endif %}

A non-existing yadm or env variable is now replaced with the empty string.
2024-11-04 22:30:23 +01:00
Tim Byrne
6d3b9dac71
Merge branch 'move' 2024-10-31 15:41:38 -05:00
Tim Byrne
e097d16d88
Update docker image used by scheduled test 2024-10-31 15:37:40 -05:00
Tim Byrne
3ecbe7ec27
Merge branch 'move' (Updating location) 2024-10-30 17:55:49 -05:00