1
0
Fork 0
mirror of synced 2024-12-21 22:21:08 -05:00
Commit graph

696 commits

Author SHA1 Message Date
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
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
Tim Byrne
38880abc68
Update repo location 2024-10-30 17:18:49 -05:00
AVM.Martin
aba434274e
fix(clone): reset index of YADM_WORK 2024-07-21 07:02:49 +07:00
AVM.Martin
12c51e130b
test(clone): run inside YADM_WORK sub-directory
Whenever using `clone` command inside YADM_WORK sub-directory, we need
to checkout the correct repo contents.

Steps to reproduce:

```bash
mkdir $HOME/subdir
cd $HOME/subdir

yadm clone --bootstrap "<repo-url>"
yadm status
```
2024-07-21 07:02:49 +07:00
Tim Byrne
0a5e7aa353
Merge pull request #470 from LFd3v/master 2023-11-12 07:33:09 -06:00
LFdev
040dd461bd
Update Arch Linux badge in README.md
community repo was merged with extra, please refer to:

https://archlinux.org/news/git-migration-announcement/
https://archlinux.org/news/git-migration-completed/
2023-11-08 23:02:14 +00:00
Tim Byrne
76ce3defea
Changes for black compliance 2023-07-12 09:20:00 -05:00
Tim Byrne
e704175201
Add black to linting 2023-07-12 09:20:00 -05:00
Tim Byrne
1b36bf2bb6
Move all test/linting configs into pyproject.toml
Except for flake8 which doesn't support pyproject.toml yet.
2023-07-12 09:19:59 -05:00
Tim Byrne
7af2af52ae
Lint using isort 2023-07-12 09:19:59 -05:00
Tim Byrne
bbc1ca17f0
Changes for new flake8 compliance 2023-07-12 09:19:59 -05:00
Tim Byrne
8a87f4a30f
Changes for new pylint compliance 2023-07-12 09:19:59 -05:00
Tim Byrne
f9e0368385
Changes for new shellcheck compliance 2023-07-12 09:19:59 -05:00
Tim Byrne
c8acf77e04
Adjust pinentry mock
The new test Docker image has a newer gnupg which does not behave the
same way, handling invalid passwords. This type of error is simulated
using an ICP error in the pinentry protocol.
2023-07-12 09:19:59 -05:00
Tim Byrne
9752d801ae
Replace deprecated "pipes" with "shlex" 2023-07-12 09:19:58 -05:00
Tim Byrne
84437894b5
Use man.REAL 2023-07-12 09:19:58 -05:00
Tim Byrne
82ba16db34
Support testing with newer version of Git 2023-07-12 09:19:58 -05:00
Tim Byrne
2253e52ab7
Update test Docker image
* Update base image (which uses a newer python)
* Update linters
* Update other dependencies
2023-07-12 09:19:53 -05:00
Tim Byrne
e4bb8a79a4
Update to shields.io new API 2023-01-23 13:51:06 -06:00
Tim Byrne
2d4dcd05ef
Update version number and update documentation
* 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)
2023-01-23 13:25:54 -06:00
Tim Byrne
5981f6329e
Adjust markdown creation for new version of groff 2023-01-23 13:16:53 -06:00
Tim Byrne
0f8538d3e3
Create tests for underscores in distro/family 2022-09-13 12:38:18 -05:00
Tim Byrne
67c684473d
Merge pull request #432 from signed-log/alt_with_spaces 2022-09-13 11:56:51 -05:00
Nicolas signed-log FORMICHELLA
8f390cf085
Accept _ as space substitutes
Replace all spaces in the ID/ID_LIKE scoring to allow for space
replacement

Signed-off-by: Nicolas signed-log FORMICHELLA <stigpro@outlook.fr>
2022-08-28 18:29:41 +02:00
Tim Byrne
36fda72bec
Remove superfluous space 2022-08-27 13:55:24 -05:00