diff --git a/bats-assert-2.0.0.tar.gz b/bats-assert-2.0.0.tar.gz new file mode 100644 index 0000000..28ecacf --- /dev/null +++ b/bats-assert-2.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15dbf1abb98db785323b9327c86ee2b3114541fe5aa150c410a1632ec06d9903 +size 14175 diff --git a/bats-file-0.3.0.tar.gz b/bats-file-0.3.0.tar.gz new file mode 100644 index 0000000..2b6b233 --- /dev/null +++ b/bats-file-0.3.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54d1c8b1908608aef8e46ac17d4001a75119e279662aeac4e5859ce780515362 +size 19235 diff --git a/bats-support-0.3.0.tar.gz b/bats-support-0.3.0.tar.gz new file mode 100644 index 0000000..6cdb32e --- /dev/null +++ b/bats-support-0.3.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7815237aafeb42ddcc1b8c698fc5808026d33317d8701d5ec2396e9634e2918f +size 10403 diff --git a/git-config-for-tests.patch b/git-config-for-tests.patch deleted file mode 100644 index 71703cc..0000000 --- a/git-config-for-tests.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- homeshick-2.0.0/test/helper.bash.orig 2022-11-16 22:11:08.095666823 +0100 -+++ homeshick-2.0.0/test/helper.bash 2022-11-16 22:12:58.279790390 +0100 -@@ -75,6 +75,9 @@ - mk_structure - # shellcheck source=homeshick.sh - source "$HOMESHICK_FN_SRC_SH" -+ -+ git config --global init.defaultBranch master -+ git config --global protocol.file.allow always - } - - function setup { diff --git a/homeshick-2.0.1.tar.gz b/homeshick-2.0.1.tar.gz new file mode 100644 index 0000000..0fa4c18 --- /dev/null +++ b/homeshick-2.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:949f5de3c7f235ceb37c08e0cc8f3f7ad166f741a8fd01bf4b935a2031e37557 +size 39207 diff --git a/homeshick.changes b/homeshick.changes index 25bed50..01f0646 100644 --- a/homeshick.changes +++ b/homeshick.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Sat May 13 16:51:17 UTC 2023 - Olav Reinert + +- Upgrade to version 2.0.1: + * Improvements to testing (@oreinert) + * Test up to and including bash v5.2.9 + * Improvements to cd and check subcommands (@me-and) + * Improvement to cd subcommand in fish (@languitar) +- Remove patch git-config-for-tests.patch: + * Included by upstream +- Add patch test-helper.patch: + * Allows tests to run on OBS; does not alter package contents + ------------------------------------------------------------------- Wed Nov 16 21:17:12 UTC 2022 - Olav Reinert diff --git a/homeshick.spec b/homeshick.spec index 14439ca..b4ffc1a 100644 --- a/homeshick.spec +++ b/homeshick.spec @@ -1,7 +1,7 @@ # # spec file for package homeshick # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,17 +17,20 @@ Name: homeshick -Version: 2.0.0 +Version: 2.0.1 Release: 0 Summary: Dotfile synchronizer based on Git and Bash License: MIT Group: Productivity/File utilities URL: https://github.com/andsens/homeshick -Source0: https://github.com/andsens/homeshick/archive/v%{version}.tar.gz +Source0: https://github.com/andsens/homeshick/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: README-openSUSE.md +Source50: https://github.com/bats-core/bats-file/archive/v0.3.0.tar.gz#/bats-file-0.3.0.tar.gz +Source51: https://github.com/bats-core/bats-support/archive/v0.3.0.tar.gz#/bats-support-0.3.0.tar.gz +Source52: https://github.com/bats-core/bats-assert/archive/v2.0.0.tar.gz#/bats-assert-2.0.0.tar.gz Source99: homeshick.rpmlintrc Patch0: suse-packaging.patch -Patch1: git-config-for-tests.patch +Patch1: test-helper.patch BuildRequires: expect BuildRequires: git >= 1.5 BuildRequires: iputils @@ -55,6 +58,12 @@ frameworks, such as oh-my-zsh, found on sites like https://dotfiles.github.io/. %patch0 -p1 %patch1 -p1 +# unpack test libraries +mkdir -p test/bats/lib +for lib in file support assert; do + tar xf %{_sourcedir}/bats-$lib-*.tar.gz -C test/bats/lib --transform "s/bats-$lib-...../$lib/" +done + %build %install @@ -67,7 +76,7 @@ cp %{SOURCE1} . %check # run tests if bats is available if type bats &>/dev/null; then - HOMESHICK_DIR=%{buildroot}%{_datadir}/%{name} bats test/suites + HOMESHICK_DIR=%{buildroot}%{_datadir}/%{name} HOMESHICK_TEST_DIR="$PWD" bats test/suites fi %files diff --git a/suse-packaging.patch b/suse-packaging.patch index 754ba94..615c9d0 100644 --- a/suse-packaging.patch +++ b/suse-packaging.patch @@ -1,20 +1,18 @@ -diff -r -u homeshick-1.1.0-orig/bin/homeshick homeshick-1.1.0/bin/homeshick ---- homeshick-1.1.0-orig/bin/homeshick 2018-04-12 21:52:30.000000000 +0200 -+++ homeshick-1.1.0/bin/homeshick 2018-06-07 21:42:03.651248460 +0200 +--- homeshick-2.0.1/bin/homeshick.orig 2023-04-14 22:54:17.855182545 +0200 ++++ homeshick-2.0.1/bin/homeshick 2023-04-14 22:55:01.868514856 +0200 @@ -1,8 +1,8 @@ -#!/usr/bin/env bash -+#!/bin/bash ++#!/usr/bin/bash repos="$HOME/.homesick/repos" # Include all helper functions. We will include the required command function later on. -homeshick=${HOMESHICK_DIR:-$HOME/.homesick/repos/homeshick} +homeshick=${HOMESHICK_DIR:-/usr/share/homeshick} - # On travis-ci exit_status for some reason errors out, ignore it - # shellcheck disable=SC1090 + # shellcheck source=../lib/exit_status.sh source "$homeshick/lib/exit_status.sh" -diff -r -u homeshick-1.1.0-orig/homeshick.csh homeshick-1.1.0/homeshick.csh ---- homeshick-1.1.0-orig/homeshick.csh 2018-04-12 21:52:30.000000000 +0200 -+++ homeshick-1.1.0/homeshick.csh 2018-06-07 21:35:03.398240964 +0200 + # shellcheck source=../lib/fs.sh +--- homeshick-2.0.1/homeshick.csh.orig 2023-04-14 22:53:32.849717688 +0200 ++++ homeshick-2.0.1/homeshick.csh 2023-04-14 22:54:03.522712974 +0200 @@ -1,6 +1,6 @@ # This helper script should be sourced via an alias, e.g. # @@ -31,40 +29,30 @@ diff -r -u homeshick-1.1.0-orig/homeshick.csh homeshick-1.1.0/homeshick.csh + /usr/share/homeshick/bin/homeshick $* endif endif -diff -r -u homeshick-1.1.0-orig/homeshick.fish homeshick-1.1.0/homeshick.fish ---- homeshick-1.1.0-orig/homeshick.fish 2018-04-12 21:52:30.000000000 +0200 -+++ homeshick-1.1.0/homeshick.fish 2018-06-07 21:35:03.398240964 +0200 +--- homeshick-2.0.1/homeshick.fish.orig 2023-04-14 22:53:32.853717802 +0200 ++++ homeshick-2.0.1/homeshick.fish 2023-04-14 22:54:03.522712974 +0200 @@ -1,5 +1,5 @@ # This script should be sourced in the context of your shell like so: -# source $HOME/.homesick/repos/homeshick/homeshick.fish +# source /usr/share/homeshick/homeshick.fish + # Alternatively, it can be installed into one of the directories + # that fish uses to autoload functions (e.g ~/.config/fish/functions) # Once the homeshick() function is defined, you can type - # "homeshick cd CASTLE" to enter a castle. - -@@ -9,6 +9,6 @@ - else if set -q HOMESHICK_DIR - eval $HOMESHICK_DIR/bin/homeshick (string escape -- $argv) - else -- eval $HOME/.homesick/repos/homeshick/bin/homeshick (string escape -- $argv) -+ eval /usr/share/homeshick/bin/homeshick (string escape -- $argv) - end +@@ -13,6 +13,6 @@ + else if set homeshick (type -P homeshick 2> /dev/null) + eval $homeshick (string escape -- $argv) + else +- eval $HOME/.homesick/repos/homeshick/bin/homeshick (string escape -- $argv) ++ eval /usr/share/homeshick/bin/homeshick (string escape -- $argv) + end end -diff -r -u homeshick-1.1.0-orig/homeshick.sh homeshick-1.1.0/homeshick.sh ---- homeshick-1.1.0-orig/homeshick.sh 2018-04-12 21:52:30.000000000 +0200 -+++ homeshick-1.1.0/homeshick.sh 2018-06-07 21:40:18.111999430 +0200 -@@ -1,6 +1,5 @@ --#!/usr/bin/env sh - # This script should be sourced in the context of your shell like so: --# source $HOME/.homesick/repos/.homeshick/homeshick.sh -+# source /usr/share/homeshick/homeshick.sh - # Once the homeshick() function is defined, you can type - # "homeshick cd CASTLE" to enter a castle. - -@@ -10,6 +9,6 @@ - # shellcheck disable=SC2164 - cd "$HOME/.homesick/repos/$2" - else -- "${HOMESHICK_DIR:-$HOME/.homesick/repos/homeshick}/bin/homeshick" "$@" -+ "${HOMESHICK_DIR:-/usr/share/homeshick}/bin/homeshick" "$@" - fi +--- homeshick-2.0.1/homeshick.sh.orig 2023-04-14 22:53:32.853717802 +0200 ++++ homeshick-2.0.1/homeshick.sh 2023-04-14 22:54:03.522712974 +0200 +@@ -10,6 +10,6 @@ + # shellcheck disable=SC2164 + cd "$HOME/.homesick/repos/$2" + else +- "${HOMESHICK_DIR:-$HOME/.homesick/repos/homeshick}/bin/homeshick" "$@" ++ "${HOMESHICK_DIR:-/usr/share/homeshick}/bin/homeshick" "$@" + fi } diff --git a/test-helper.patch b/test-helper.patch new file mode 100644 index 0000000..e1e64f4 --- /dev/null +++ b/test-helper.patch @@ -0,0 +1,24 @@ +--- homeshick-2.0.1/test/helper.sh.orig 2023-05-13 19:53:54.462114112 +0200 ++++ homeshick-2.0.1/test/helper.sh 2023-05-13 20:10:46.242708858 +0200 +@@ -16,8 +16,10 @@ + } + + determine_homeshick_dir() { +- HOMESHICK_DIR=$(cd "$BATS_TEST_DIRNAME/../.." && echo "$PWD") +- export HOMESHICK_DIR ++ if [ -z "$HOMESHICK_DIR" ]; then ++ HOMESHICK_DIR=$(cd "$BATS_TEST_DIRNAME/../.." && echo "$PWD") ++ export HOMESHICK_DIR ++ fi + } + + create_test_dir() { +@@ -67,7 +69,7 @@ + local name=$1 + if [[ ! -e "$REPO_FIXTURES/$name" ]]; then + # shellcheck disable=SC1090 +- source "$HOMESHICK_DIR/test/fixtures/$name.sh" ++ source "$HOMESHICK_TEST_DIR/test/fixtures/$name.sh" + fi + } + diff --git a/v2.0.0.tar.gz b/v2.0.0.tar.gz deleted file mode 100644 index 45383e1..0000000 --- a/v2.0.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:14a538bfc2e7cb6bfd35c984cdedbf3d3293413a70cc67f685dbfbd33ce64fdd -size 33094