Skip to content

Commit 5648f8b

Browse files
committed
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)
2 parents ec10041 + c90aa86 commit 5648f8b

48 files changed

Lines changed: 1270 additions & 1005 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 120 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,129 @@
11
---
22
name: Tests
3+
34
on: # yamllint disable-line rule:truthy
45
- push
56
- pull_request
67
- workflow_dispatch
8+
9+
env:
10+
SC_VER: "0.10.0"
11+
ESH_VER: "0.3.2"
12+
713
jobs:
814
Tests:
9-
runs-on: ubuntu-latest
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os:
20+
- ubuntu-20.04
21+
- ubuntu-24.04
22+
- macos-13
23+
- macos-15
24+
- windows-2022
25+
26+
defaults:
27+
run:
28+
shell: bash
29+
1030
steps:
11-
- uses: actions/checkout@v2
12-
- name: Tests
13-
run: make test
31+
- uses: actions/checkout@v4
32+
33+
- uses: Vampire/setup-wsl@v4
34+
if: ${{ runner.os == 'Windows' }}
35+
36+
- name: Install dependencies on Linux
37+
if: ${{ runner.os == 'Linux' }}
38+
run: |
39+
sudo apt-get update
40+
sudo apt-get install -y \
41+
expect \
42+
${{ matrix.os != 'ubuntu-20.04' && 'j2cli' || '' }}
43+
44+
- name: Install dependencies on macOS
45+
if: ${{ runner.os == 'macOS' }}
46+
run: |
47+
command -v expect || brew install expect
48+
49+
- name: Install dependencies on Windows (WSL)
50+
if: ${{ runner.os == 'Windows' }}
51+
shell: wsl-bash {0}
52+
run: |
53+
apt-get update
54+
apt-get install -y --no-install-recommends \
55+
dos2unix \
56+
expect \
57+
gettext-base \
58+
git \
59+
gnupg \
60+
j2cli \
61+
lsb-release \
62+
man \
63+
python3-pip
64+
65+
- name: Prepare tools directory
66+
run: |
67+
mkdir "${{ runner.temp }}/tools"
68+
echo "${{ runner.temp }}/tools" >> "${{ github.path }}"
69+
70+
- name: Install shellcheck
71+
run: |
72+
cd "${{ runner.temp }}"
73+
74+
OS=${{ runner.os == 'macOS' && 'darwin' || 'linux' }}
75+
ARCH=${{ runner.arch == 'ARM64' && 'aarch64' || 'x86_64' }}
76+
77+
BASE_URL="https://github.com/koalaman/shellcheck/releases/download"
78+
SC="v$SC_VER/shellcheck-v$SC_VER.$OS.$ARCH.tar.xz"
79+
80+
curl -L "$BASE_URL/$SC" | tar Jx shellcheck-v$SC_VER/shellcheck
81+
mv shellcheck-v$SC_VER/shellcheck tools
82+
83+
- name: Install esh
84+
run: |
85+
cd "${{ runner.temp }}/tools"
86+
87+
BASE_URL="https://github.com/jirutka/esh/raw/refs/tags"
88+
curl -L -o esh "$BASE_URL/v$ESH_VER/esh"
89+
chmod +x esh
90+
91+
- name: Add old yadm versions # to test upgrades
92+
run: |
93+
for version in 1.12.0 2.5.0; do
94+
git fetch origin $version:refs/tags/$version
95+
git cat-file blob $version:yadm \
96+
> "${{ runner.temp }}/tools/yadm-$version"
97+
chmod +x "${{ runner.temp }}/tools/yadm-$version"
98+
done
99+
100+
- name: Set up Python 3.11
101+
if: ${{ runner.os == 'macOS' || matrix.os == 'ubuntu-20.04' }}
102+
uses: actions/setup-python@v5
103+
with:
104+
python-version: 3.11
105+
106+
- name: Install dependencies and run tests (Linux/macOS)
107+
if: ${{ runner.os != 'Windows' }}
108+
run: |
109+
git config --global user.email test@yadm.io
110+
git config --global user.name "Yadm Test"
111+
112+
python3 -m pip install --upgrade pip
113+
python3 -m pip install -r test/requirements.txt
114+
pytest -v --color=yes --basetemp="${{ runner.temp }}/pytest"
115+
116+
- name: Install dependencies and run tests (WSL)
117+
if: ${{ runner.os == 'Windows' }}
118+
shell: wsl-bash {0}
119+
run: |
120+
git config --global user.email test@yadm.io
121+
git config --global user.name "Yadm Test"
122+
git config --global protocol.file.allow always
123+
124+
dos2unix yadm.1 .github/workflows/*.yml test/pinentry-mock
125+
chmod +x test/pinentry-mock
126+
127+
python3 -m pip install --upgrade pip
128+
python3 -m pip install -r test/requirements.txt
129+
pytest -v --color=yes

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
.testyadm
66
_site
77
testenv
8+
__pycache__/

CHANGES

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
3.4.0
2+
* Improve and harden alt file regeneration (#466)
3+
* Fix "yadm config" in fish completion (#491)
4+
* Fix "yadm clone" when not run in "$YADM_WORK" (#513)
5+
* Output the actual paths in help message (#376)
6+
* Verify all alt conditions for templates (#478)
7+
* Ignore case in alt and default template conditions (#455, #456)
8+
* Fall back to ID for distro family if ID_LIKE is not available (#494)
9+
* Support overriding distro and distro family (#430)
10+
* Improve support for Bash 3 (the default version on macOS)
11+
* Make "yadm clone --recursive" work as expected (#517)
12+
* Don't include files multiple times in archive (#125)
13+
* Document YADM_HOOK_DATA and YADM_HOOK_DIR env variables (#343)
14+
* Support alt dirs with deeply nested tracked files (#495)
15+
116
3.3.0
217
* Support nested ifs in default template (#436)
318
* Support include and ifs in default template includes (#406)

CONTRIBUTORS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ CONTRIBUTORS
33
Tim Byrne
44
Erik Flodin
55
Martin Zuther
6-
Jan Schulz
76
Ross Smith II
7+
Jan Schulz
88
Jonathan Daigle
99
Luis López
1010
Tin Lai
@@ -15,11 +15,13 @@ James Clark
1515
Glenn Waters
1616
Nicolas signed-log FORMICHELLA
1717
Tomas Cernaj
18+
AVM.Martin
1819
Joshua Cold
1920
jonasc
2021
Nicolas stig124 FORMICHELLA
2122
Chad Wade Day, Jr
2223
Sébastien Gross
24+
Christof Warlich
2325
David Mandelberg
2426
Paulo Köch
2527
Oren Zipori
@@ -47,6 +49,7 @@ Tim Condit
4749
Thomas Luzat
4850
Russ Allbery
4951
Patrick Roddy
52+
heddxh
5053
dessert1
5154
Brayden Banks
5255
Alexandre GV

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PYTESTS = $(wildcard test/test_*.py)
2-
IMAGE = docker.io/yadm/testbed:2023-07-12
2+
IMAGE = docker.io/yadm/testbed:2024-11-11
33
OCI = docker
44

55
.PHONY: all
@@ -176,7 +176,7 @@ man-ps:
176176
@groff -man -Tps ./yadm.1 > yadm.ps
177177

178178
yadm.md: yadm.1
179-
@groff -man -Tutf8 -Z ./yadm.1 | grotty -c | col -bx | sed 's/^[A-Z]/## &/g' | sed '/yadm(1)/d' > yadm.md
179+
@groff -man -Tutf8 -Z ./yadm.1 | grotty -c | col -bx | sed 's/^[A-Z]/## &/g' | sed '/YADM(1)/d' > yadm.md
180180

181181
.PHONY: contrib
182182
contrib: SHELL = /bin/bash

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ The star count helps others discover yadm.
7878
[master-badge]: https://img.shields.io/github/actions/workflow/status/yadm-dev/yadm/test.yml?branch=master
7979
[master-commits]: https://github.com/yadm-dev/yadm/commits/master
8080
[master-date]: https://img.shields.io/github/last-commit/yadm-dev/yadm/master.svg?label=master
81-
[obs-badge]: https://img.shields.io/badge/OBS-v3.3.0-blue
82-
[obs-link]: https://software.opensuse.org//download.html?project=home%3ATheLocehiliosan%3Ayadm&package=yadm
81+
[obs-badge]: https://img.shields.io/badge/OBS-v3.4.0-blue
82+
[obs-link]: https://software.opensuse.org/download.html?project=home%3ATheLocehiliosan%3Ayadm&package=yadm
8383
[releases-badge]: https://img.shields.io/github/tag/yadm-dev/yadm.svg?label=latest+release
8484
[releases-link]: https://github.com/yadm-dev/yadm/releases
8585
[transcrypt]: https://github.com/elasticdog/transcrypt

bootstrap

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,20 @@ REPO_URL=""
3535

3636
function _private_yadm() {
3737
unset -f yadm
38-
if command -v yadm &> /dev/null; then
38+
if command -v yadm &>/dev/null; then
3939
echo "Found yadm installed locally, removing remote yadm() function"
4040
unset -f _private_yadm
4141
command yadm "$@"
4242
else
43-
function yadm() { _private_yadm "$@"; }; export -f yadm
43+
function yadm() { _private_yadm "$@"; }
44+
export -f yadm
4445
echo WARNING: Using yadm remotely. You should install yadm locally.
4546
curl -fsSL "$YADM_REPO/raw/$YADM_RELEASE/yadm" | bash -s -- "$@"
4647
fi
4748
}
4849
export -f _private_yadm
49-
function yadm() { _private_yadm "$@"; }; export -f yadm
50+
function yadm() { _private_yadm "$@"; }
51+
export -f yadm
5052

5153
# if being sourced, return here, otherwise continue processing
5254
return 2>/dev/null
@@ -57,7 +59,7 @@ function remote_yadm() {
5759
}
5860

5961
function ask_about_source() {
60-
if ! command -v yadm &> /dev/null; then
62+
if ! command -v yadm &>/dev/null; then
6163
echo
6264
echo "***************************************************"
6365
echo "yadm is NOT currently installed."
@@ -83,7 +85,7 @@ function build_url() {
8385
echo " 3. GitLab"
8486
echo " 4. Other"
8587
echo
86-
read -r -p "Where is your repo? (1/2/3/4) ->" choice < /dev/tty
88+
read -r -p "Where is your repo? (1/2/3/4) ->" choice </dev/tty
8789
case $choice in
8890
1)
8991
REPO_URL="https://github.com/"
@@ -97,7 +99,7 @@ function build_url() {
9799
*)
98100
echo
99101
echo Please specify the full URL of your dotfiles repo
100-
read -r -p "URL ->" choice < /dev/tty
102+
read -r -p "URL ->" choice </dev/tty
101103
REPO_URL="$choice"
102104
return
103105
;;
@@ -107,7 +109,7 @@ function build_url() {
107109
echo "Provide your user and repo separated by '/'"
108110
echo "For example: UserName/dotfiles"
109111
echo
110-
read -r -p "User/Repo ->" choice < /dev/tty
112+
read -r -p "User/Repo ->" choice </dev/tty
111113
[[ "$choice" =~ ^[^[:space:]]+/[^[:space:]]+$ ]] || {
112114
echo "Not formatted as USER/REPO"
113115
REPO_URL=

completion/fish/yadm.fish

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ complete -x -c yadm -n '__fish_yadm_using_command introspect' -a (printf -- '%s\
6060
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'gitconfig' -d 'Pass options to the git config command'
6161
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'config' -d 'Configure a setting'
6262
for name in (yadm introspect configs)
63-
complete -x -c yadm -n '__fish_yadm_using_command config' -a '$name' -d 'yadm config'
63+
complete -x -c yadm -n '__fish_yadm_using_command config' -a $name -d 'yadm config'
6464
end
6565

6666
# yadm universial options

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ markers = [
77

88
[tool.pylint.design]
99
max-args = 14
10+
max-positional-arguments = 10
1011
max-locals = 28
1112
max-attributes = 8
1213
max-statements = 65

test/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
FROM ubuntu:23.04
2-
MAINTAINER Tim Byrne <sultan@locehilios.com>
1+
FROM ubuntu:24.10
32

43
# Shellcheck and esh versions
5-
ARG SC_VER=0.9.0
4+
ARG SC_VER=0.10.0
65
ARG ESH_VER=0.3.2
76

87
# Install prerequisites and configure UTF-8 locale
@@ -14,6 +13,7 @@ RUN \
1413
expect \
1514
git \
1615
gnupg \
16+
j2cli \
1717
locales \
1818
lsb-release \
1919
make \
@@ -39,10 +39,9 @@ RUN cd /opt \
3939
&& rm -f shellcheck-v$SC_VER.linux.x86_64.tar.xz \
4040
&& ln -s /opt/shellcheck-v$SC_VER/shellcheck /usr/local/bin
4141

42-
# Upgrade pip3 and install requirements
42+
# Install requirements
4343
COPY test/requirements.txt /tmp/requirements.txt
44-
RUN python3 -m pip install --break-system-packages --upgrade pip setuptools \
45-
&& python3 -m pip install --break-system-packages --upgrade -r /tmp/requirements.txt \
44+
RUN python3 -m pip install --break-system-packages -r /tmp/requirements.txt \
4645
&& rm -f /tmp/requirements
4746

4847
# Install esh

0 commit comments

Comments
 (0)