Skip to content

Commit

Permalink
Release 3.4.0
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
erijo committed Feb 9, 2025
2 parents ec10041 + c90aa86 commit 5648f8b
Show file tree
Hide file tree
Showing 48 changed files with 1,270 additions and 1,005 deletions.
124 changes: 120 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,129 @@
---
name: Tests

on: # yamllint disable-line rule:truthy
- push
- pull_request
- workflow_dispatch

env:
SC_VER: "0.10.0"
ESH_VER: "0.3.2"

jobs:
Tests:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-24.04
- macos-13
- macos-15
- windows-2022

defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v2
- name: Tests
run: make test
- uses: actions/checkout@v4

- uses: Vampire/setup-wsl@v4
if: ${{ runner.os == 'Windows' }}

- name: Install dependencies on Linux
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install -y \
expect \
${{ matrix.os != 'ubuntu-20.04' && 'j2cli' || '' }}
- name: Install dependencies on macOS
if: ${{ runner.os == 'macOS' }}
run: |
command -v expect || brew install expect
- name: Install dependencies on Windows (WSL)
if: ${{ runner.os == 'Windows' }}
shell: wsl-bash {0}
run: |
apt-get update
apt-get install -y --no-install-recommends \
dos2unix \
expect \
gettext-base \
git \
gnupg \
j2cli \
lsb-release \
man \
python3-pip
- name: Prepare tools directory
run: |
mkdir "${{ runner.temp }}/tools"
echo "${{ runner.temp }}/tools" >> "${{ github.path }}"
- name: Install shellcheck
run: |
cd "${{ runner.temp }}"
OS=${{ runner.os == 'macOS' && 'darwin' || 'linux' }}
ARCH=${{ runner.arch == 'ARM64' && 'aarch64' || 'x86_64' }}
BASE_URL="https://github.com/koalaman/shellcheck/releases/download"
SC="v$SC_VER/shellcheck-v$SC_VER.$OS.$ARCH.tar.xz"
curl -L "$BASE_URL/$SC" | tar Jx shellcheck-v$SC_VER/shellcheck
mv shellcheck-v$SC_VER/shellcheck tools
- name: Install esh
run: |
cd "${{ runner.temp }}/tools"
BASE_URL="https://github.com/jirutka/esh/raw/refs/tags"
curl -L -o esh "$BASE_URL/v$ESH_VER/esh"
chmod +x esh
- name: Add old yadm versions # to test upgrades
run: |
for version in 1.12.0 2.5.0; do
git fetch origin $version:refs/tags/$version
git cat-file blob $version:yadm \
> "${{ runner.temp }}/tools/yadm-$version"
chmod +x "${{ runner.temp }}/tools/yadm-$version"
done
- name: Set up Python 3.11
if: ${{ runner.os == 'macOS' || matrix.os == 'ubuntu-20.04' }}
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install dependencies and run tests (Linux/macOS)
if: ${{ runner.os != 'Windows' }}
run: |
git config --global user.email [email protected]
git config --global user.name "Yadm Test"
python3 -m pip install --upgrade pip
python3 -m pip install -r test/requirements.txt
pytest -v --color=yes --basetemp="${{ runner.temp }}/pytest"
- name: Install dependencies and run tests (WSL)
if: ${{ runner.os == 'Windows' }}
shell: wsl-bash {0}
run: |
git config --global user.email [email protected]
git config --global user.name "Yadm Test"
git config --global protocol.file.allow always
dos2unix yadm.1 .github/workflows/*.yml test/pinentry-mock
chmod +x test/pinentry-mock
python3 -m pip install --upgrade pip
python3 -m pip install -r test/requirements.txt
pytest -v --color=yes
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
.testyadm
_site
testenv
__pycache__/
15 changes: 15 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
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)

3.3.0
* Support nested ifs in default template (#436)
* Support include and ifs in default template includes (#406)
Expand Down
5 changes: 4 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ CONTRIBUTORS
Tim Byrne
Erik Flodin
Martin Zuther
Jan Schulz
Ross Smith II
Jan Schulz
Jonathan Daigle
Luis López
Tin Lai
Expand All @@ -15,11 +15,13 @@ James Clark
Glenn Waters
Nicolas signed-log FORMICHELLA
Tomas Cernaj
AVM.Martin
Joshua Cold
jonasc
Nicolas stig124 FORMICHELLA
Chad Wade Day, Jr
Sébastien Gross
Christof Warlich
David Mandelberg
Paulo Köch
Oren Zipori
Expand Down Expand Up @@ -47,6 +49,7 @@ Tim Condit
Thomas Luzat
Russ Allbery
Patrick Roddy
heddxh
dessert1
Brayden Banks
Alexandre GV
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PYTESTS = $(wildcard test/test_*.py)
IMAGE = docker.io/yadm/testbed:2023-07-12
IMAGE = docker.io/yadm/testbed:2024-11-11
OCI = docker

.PHONY: all
Expand Down Expand Up @@ -176,7 +176,7 @@ man-ps:
@groff -man -Tps ./yadm.1 > yadm.ps

yadm.md: yadm.1
@groff -man -Tutf8 -Z ./yadm.1 | grotty -c | 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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ The star count helps others discover yadm.
[master-badge]: https://img.shields.io/github/actions/workflow/status/yadm-dev/yadm/test.yml?branch=master
[master-commits]: https://github.com/yadm-dev/yadm/commits/master
[master-date]: https://img.shields.io/github/last-commit/yadm-dev/yadm/master.svg?label=master
[obs-badge]: https://img.shields.io/badge/OBS-v3.3.0-blue
[obs-link]: https://software.opensuse.org//download.html?project=home%3ATheLocehiliosan%3Ayadm&package=yadm
[obs-badge]: https://img.shields.io/badge/OBS-v3.4.0-blue
[obs-link]: https://software.opensuse.org/download.html?project=home%3ATheLocehiliosan%3Ayadm&package=yadm
[releases-badge]: https://img.shields.io/github/tag/yadm-dev/yadm.svg?label=latest+release
[releases-link]: https://github.com/yadm-dev/yadm/releases
[transcrypt]: https://github.com/elasticdog/transcrypt
Expand Down
16 changes: 9 additions & 7 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,20 @@ REPO_URL=""

function _private_yadm() {
unset -f yadm
if command -v yadm &> /dev/null; then
if command -v yadm &>/dev/null; then
echo "Found yadm installed locally, removing remote yadm() function"
unset -f _private_yadm
command yadm "$@"
else
function yadm() { _private_yadm "$@"; }; export -f yadm
function yadm() { _private_yadm "$@"; }
export -f yadm
echo WARNING: Using yadm remotely. You should install yadm locally.
curl -fsSL "$YADM_REPO/raw/$YADM_RELEASE/yadm" | bash -s -- "$@"
fi
}
export -f _private_yadm
function yadm() { _private_yadm "$@"; }; export -f yadm
function yadm() { _private_yadm "$@"; }
export -f yadm

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

function ask_about_source() {
if ! command -v yadm &> /dev/null; then
if ! command -v yadm &>/dev/null; then
echo
echo "***************************************************"
echo "yadm is NOT currently installed."
Expand All @@ -83,7 +85,7 @@ function build_url() {
echo " 3. GitLab"
echo " 4. Other"
echo
read -r -p "Where is your repo? (1/2/3/4) ->" choice < /dev/tty
read -r -p "Where is your repo? (1/2/3/4) ->" choice </dev/tty
case $choice in
1)
REPO_URL="https://github.com/"
Expand All @@ -97,7 +99,7 @@ function build_url() {
*)
echo
echo Please specify the full URL of your dotfiles repo
read -r -p "URL ->" choice < /dev/tty
read -r -p "URL ->" choice </dev/tty
REPO_URL="$choice"
return
;;
Expand All @@ -107,7 +109,7 @@ function build_url() {
echo "Provide your user and repo separated by '/'"
echo "For example: UserName/dotfiles"
echo
read -r -p "User/Repo ->" choice < /dev/tty
read -r -p "User/Repo ->" choice </dev/tty
[[ "$choice" =~ ^[^[:space:]]+/[^[:space:]]+$ ]] || {
echo "Not formatted as USER/REPO"
REPO_URL=
Expand Down
2 changes: 1 addition & 1 deletion completion/fish/yadm.fish
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ complete -x -c yadm -n '__fish_yadm_using_command introspect' -a (printf -- '%s\
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'gitconfig' -d 'Pass options to the git config command'
complete -x -c yadm -n '__fish_yadm_needs_command' -a 'config' -d 'Configure a setting'
for name in (yadm introspect configs)
complete -x -c yadm -n '__fish_yadm_using_command config' -a '$name' -d 'yadm config'
complete -x -c yadm -n '__fish_yadm_using_command config' -a $name -d 'yadm config'
end

# yadm universial options
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ markers = [

[tool.pylint.design]
max-args = 14
max-positional-arguments = 10
max-locals = 28
max-attributes = 8
max-statements = 65
Expand Down
11 changes: 5 additions & 6 deletions test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
FROM ubuntu:23.04
MAINTAINER Tim Byrne <[email protected]>
FROM ubuntu:24.10

# Shellcheck and esh versions
ARG SC_VER=0.9.0
ARG SC_VER=0.10.0
ARG ESH_VER=0.3.2

# Install prerequisites and configure UTF-8 locale
Expand All @@ -14,6 +13,7 @@ RUN \
expect \
git \
gnupg \
j2cli \
locales \
lsb-release \
make \
Expand All @@ -39,10 +39,9 @@ RUN cd /opt \
&& rm -f shellcheck-v$SC_VER.linux.x86_64.tar.xz \
&& ln -s /opt/shellcheck-v$SC_VER/shellcheck /usr/local/bin

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

# Install esh
Expand Down
Loading

0 comments on commit 5648f8b

Please sign in to comment.