From f9cdb1c07820e9796e94a6f2aee62f3e7e0d7240 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 09:18:36 +0000 Subject: [PATCH 1/9] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- which.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/which.spec b/which.spec index 9a568b1..18ebe1a 100644 --- a/which.spec +++ b/which.spec @@ -3,7 +3,7 @@ Summary: Displays where a particular program in your path is located Name: which Version: 2.21 -Release: 41%{?dist} +Release: 42%{?dist} License: GPL-3.0-only Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz Source1: which2.sh @@ -47,6 +47,9 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %{_mandir}/man1/which.1* %changelog +* Sat Jul 20 2024 Fedora Release Engineering - 2.21-42 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Sat Jan 27 2024 Fedora Release Engineering - 2.21-41 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 01febed4623519db7e796a97946a27b6536ec71f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 14:58:54 +0000 Subject: [PATCH 2/9] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- which.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/which.spec b/which.spec index 18ebe1a..0fe0527 100644 --- a/which.spec +++ b/which.spec @@ -3,7 +3,7 @@ Summary: Displays where a particular program in your path is located Name: which Version: 2.21 -Release: 42%{?dist} +Release: 43%{?dist} License: GPL-3.0-only Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz Source1: which2.sh @@ -47,6 +47,9 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %{_mandir}/man1/which.1* %changelog +* Sun Jan 19 2025 Fedora Release Engineering - 2.21-43 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Sat Jul 20 2024 Fedora Release Engineering - 2.21-42 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From af5b87327273b13d96fd9c3928012543b04c3653 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Mon, 27 Jan 2025 10:35:14 +0100 Subject: [PATCH 3/9] Fixed rhbz#2342020, update to 2.22 --- .gitignore | 1 + sources | 2 +- which-2.21-coverity-fixes.patch | 65 --------------------------------- which-2.21-path_max.patch | 46 ----------------------- which-2.21-warning.patch | 13 +++++++ which.spec | 10 +++-- 6 files changed, 21 insertions(+), 116 deletions(-) delete mode 100644 which-2.21-coverity-fixes.patch delete mode 100644 which-2.21-path_max.patch create mode 100644 which-2.21-warning.patch diff --git a/.gitignore b/.gitignore index e93fa2c..f2decb0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ which-2.18.tar.gz which-2.19.tar.gz /which-2.20.tar.gz /which-2.21.tar.gz +/which-2.22.tar.gz diff --git a/sources b/sources index 4b6d13d..0effe33 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -097ff1a324ae02e0a3b0369f07a7544a which-2.21.tar.gz +SHA512 (which-2.22.tar.gz) = faa56d0ba1e4bd33c5e2adee5f580884d8dc8b0835a0e5360485e1d0a6fd581bcb3115d550750c7a2f867372034375d00aa9362312aede5d814e116bcacfe627 diff --git a/which-2.21-coverity-fixes.patch b/which-2.21-coverity-fixes.patch deleted file mode 100644 index fbcb636..0000000 --- a/which-2.21-coverity-fixes.patch +++ /dev/null @@ -1,65 +0,0 @@ -diff -up which-2.21/tilde/tilde.c.coverity which-2.21/tilde/tilde.c ---- which-2.21/tilde/tilde.c.coverity 2008-01-16 18:51:57.000000000 +0100 -+++ which-2.21/tilde/tilde.c 2021-03-21 11:43:00.338160051 +0100 -@@ -193,10 +193,10 @@ tilde_expand (string) - const char *string; - { - char *result; -- int result_size, result_index; -+ int result_size = 0, result_index = 0; - -- result_index = result_size = 0; -- if (result = strchr (string, '~')) -+ result = strchr (string, '~'); -+ if (result) - result = (char *)xmalloc (result_size = (strlen (string) + 16)); - else - result = (char *)xmalloc (result_size = (strlen (string) + 1)); -@@ -270,7 +270,7 @@ isolate_tilde_prefix (fname, lenp) - char *ret; - int i; - -- ret = (char *)xmalloc (strlen (fname)); -+ ret = (char *)xmalloc (strlen (fname) + 1); - #if defined (__MSDOS__) - for (i = 1; fname[i] && fname[i] != '/' && fname[i] != '\\'; i++) - #else -diff -up which-2.21/which.c.coverity which-2.21/which.c ---- which-2.21/which.c.coverity 2015-03-19 17:50:24.000000000 +0100 -+++ which-2.21/which.c 2021-03-21 12:19:31.289160885 +0100 -@@ -76,16 +76,16 @@ static int skip_functions = 0, read_func - - static char *find_command_in_path(const char *name, const char *path_list, int *path_index) - { -- char *found = NULL, *full_path; -+ char *found = NULL, *full_path = NULL; - int status, name_len; - - name_len = strlen(name); -+ char *p; - - if (!absolute_program(name)) - absolute_path_given = 0; - else - { -- char *p; - absolute_path_given = 1; - - if (abs_path) -@@ -159,6 +159,7 @@ static char *find_command_in_path(const - free(full_path); - } - -+ name = NULL; p = NULL; path_list = NULL; - return (found); - } - -@@ -540,7 +541,7 @@ int main(int argc, char *argv[]) - int function_start_type = 0; - if (read_alias || read_functions) - { -- char buf[1024]; -+ char buf[1024] = {}; - int processing_aliases = read_alias; - - if (isatty(0)) diff --git a/which-2.21-path_max.patch b/which-2.21-path_max.patch deleted file mode 100644 index eec9958..0000000 --- a/which-2.21-path_max.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff -up which-2.21/which.c.me which-2.21/which.c ---- which-2.21/which.c.me 2022-11-07 13:11:03.580798950 +0100 -+++ which-2.21/which.c 2022-11-07 15:45:41.366085798 +0100 -@@ -19,10 +19,15 @@ - #include "sys.h" - #include - #include -+#include - #include "getopt.h" - #include "tilde/tilde.h" - #include "bash.h" - -+#ifndef PATH_MAX -+#define PATH_MAX 4096 -+#endif -+ - static const char *progname; - - static void print_usage(FILE *out) -@@ -63,7 +68,7 @@ static void print_fail(const char *name, - fprintf(stderr, "%s: no %s in (%s)\n", progname, name, path_list); - } - --static char home[256]; -+static char home[PATH_MAX]; - static size_t homelen = 0; - - static int absolute_path_given; -@@ -163,7 +168,7 @@ static char *find_command_in_path(const - return (found); - } - --static char cwd[256]; -+static char cwd[PATH_MAX]; - static size_t cwdlen; - - static void get_current_working_directory(void) -@@ -195,7 +200,7 @@ static void get_current_working_director - - static char *path_clean_up(const char *path) - { -- static char result[256]; -+ static char result[PATH_MAX]; - - const char *p1 = path; - char *p2 = result; diff --git a/which-2.21-warning.patch b/which-2.21-warning.patch new file mode 100644 index 0000000..6031014 --- /dev/null +++ b/which-2.21-warning.patch @@ -0,0 +1,13 @@ +diff -up which-2.22/tilde.c.me which-2.22/tilde.c +--- which-2.22/tilde.c.me 2025-01-27 10:30:39.731725763 +0100 ++++ which-2.22/tilde.c 2025-01-27 10:32:11.158379146 +0100 +@@ -189,7 +189,8 @@ char *tilde_expand(const char *string) + int result_size, result_index; + + result_index = result_size = 0; +- if (result = strchr(string, '~')) ++ result = strchr(string, '~'); ++ if (result) + result = (char *) xmalloc(result_size = (strlen(string) + 16)); + else + result = (char *) xmalloc(result_size = (strlen(string) + 1)); diff --git a/which.spec b/which.spec index 0fe0527..d5d0559 100644 --- a/which.spec +++ b/which.spec @@ -2,14 +2,13 @@ Summary: Displays where a particular program in your path is located Name: which -Version: 2.21 -Release: 43%{?dist} +Version: 2.22 +Release: 1%{?dist} License: GPL-3.0-only Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz Source1: which2.sh Source2: which2.csh -Patch0: which-2.21-coverity-fixes.patch -Patch1: which-2.21-path_max.patch +Patch0: which-2.21-warning.patch Url: https://savannah.gnu.org/projects/which/ Requires: coreutils BuildRequires: make @@ -47,6 +46,9 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %{_mandir}/man1/which.1* %changelog +* Mon Jan 27 2025 Than Ngo - 2.22-1 +- Fixed rhbz#2342020, update to 2.22 + * Sun Jan 19 2025 Fedora Release Engineering - 2.21-43 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From eaa063e13ee0ee38934a9a1dbb6892a09565eec9 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Mon, 27 Jan 2025 11:16:27 +0100 Subject: [PATCH 4/9] Add BR on gcc-c++ --- which.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/which.spec b/which.spec index d5d0559..de922ac 100644 --- a/which.spec +++ b/which.spec @@ -12,7 +12,7 @@ Patch0: which-2.21-warning.patch Url: https://savannah.gnu.org/projects/which/ Requires: coreutils BuildRequires: make -BuildRequires: gcc +BuildRequires: gcc gcc-c++ BuildRequires: readline-devel %description From 7868f048fbcce35aafc6c00b2fda3ff381fa192b Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Sat, 1 Feb 2025 22:38:21 +0100 Subject: [PATCH 5/9] Fixed rhbz#2343113, regression --- which-2.22-regression.patch | 12 ++++++++++++ which.spec | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 which-2.22-regression.patch diff --git a/which-2.22-regression.patch b/which-2.22-regression.patch new file mode 100644 index 0000000..1eb652b --- /dev/null +++ b/which-2.22-regression.patch @@ -0,0 +1,12 @@ +diff -up which-2.22/which.c.me which-2.22/which.c +--- which-2.22/which.c.me 2025-02-01 22:35:34.519760450 +0100 ++++ which-2.22/which.c 2025-02-01 22:35:48.988116981 +0100 +@@ -278,7 +278,7 @@ static char *path_clean_up(const char *p + strcpy(result, path); + return result; + } +- if (!IS_DIRSEP(*p2)) ++ if (IS_DIRSEP(*p2)) + ++cnt; + } + while (cnt != 3); diff --git a/which.spec b/which.spec index de922ac..17d8a6e 100644 --- a/which.spec +++ b/which.spec @@ -3,12 +3,13 @@ Summary: Displays where a particular program in your path is located Name: which Version: 2.22 -Release: 1%{?dist} +Release: 2%{?dist} License: GPL-3.0-only Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz Source1: which2.sh Source2: which2.csh Patch0: which-2.21-warning.patch +Patch1: which-2.22-regression.patch Url: https://savannah.gnu.org/projects/which/ Requires: coreutils BuildRequires: make @@ -46,6 +47,9 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %{_mandir}/man1/which.1* %changelog +* Sat Feb 01 2025 Than Ngo - 2.22-2 +- Fixed rhbz#2343113, regression + * Mon Jan 27 2025 Than Ngo - 2.22-1 - Fixed rhbz#2342020, update to 2.22 From 227e833d5306dfce404a209f1fed24a9ff4cd178 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Mon, 3 Feb 2025 15:49:08 +0100 Subject: [PATCH 6/9] Fixed rhbz#2343361, update to 2.23 --- .gitignore | 1 + sources | 2 +- which-2.22-regression.patch | 12 ------------ which.spec | 8 +++++--- 4 files changed, 7 insertions(+), 16 deletions(-) delete mode 100644 which-2.22-regression.patch diff --git a/.gitignore b/.gitignore index f2decb0..ebf70cb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ which-2.19.tar.gz /which-2.20.tar.gz /which-2.21.tar.gz /which-2.22.tar.gz +/which-2.23.tar.gz diff --git a/sources b/sources index 0effe33..493334d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (which-2.22.tar.gz) = faa56d0ba1e4bd33c5e2adee5f580884d8dc8b0835a0e5360485e1d0a6fd581bcb3115d550750c7a2f867372034375d00aa9362312aede5d814e116bcacfe627 +SHA512 (which-2.23.tar.gz) = 738807f79e8cfc5967541a28ae7021247c04c4177279f09be2c19c069af450a7e3b19baf9079fe5569b25b4630bb400be242a123647e52c9fe54f0ad007317bf diff --git a/which-2.22-regression.patch b/which-2.22-regression.patch deleted file mode 100644 index 1eb652b..0000000 --- a/which-2.22-regression.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up which-2.22/which.c.me which-2.22/which.c ---- which-2.22/which.c.me 2025-02-01 22:35:34.519760450 +0100 -+++ which-2.22/which.c 2025-02-01 22:35:48.988116981 +0100 -@@ -278,7 +278,7 @@ static char *path_clean_up(const char *p - strcpy(result, path); - return result; - } -- if (!IS_DIRSEP(*p2)) -+ if (IS_DIRSEP(*p2)) - ++cnt; - } - while (cnt != 3); diff --git a/which.spec b/which.spec index 17d8a6e..85af794 100644 --- a/which.spec +++ b/which.spec @@ -2,14 +2,13 @@ Summary: Displays where a particular program in your path is located Name: which -Version: 2.22 -Release: 2%{?dist} +Version: 2.23 +Release: 1%{?dist} License: GPL-3.0-only Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz Source1: which2.sh Source2: which2.csh Patch0: which-2.21-warning.patch -Patch1: which-2.22-regression.patch Url: https://savannah.gnu.org/projects/which/ Requires: coreutils BuildRequires: make @@ -47,6 +46,9 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %{_mandir}/man1/which.1* %changelog +* Mon Feb 03 2025 Than Ngo - 2.23-1 +- Fixed rhbz#2343361, update to 2.23 + * Sat Feb 01 2025 Than Ngo - 2.22-2 - Fixed rhbz#2343113, regression From d6c3c6e51783bc42154a81e0ad53e45723fabc86 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Wed, 18 Jun 2025 17:36:05 +0200 Subject: [PATCH 7/9] Add a check to ensure that /proc/$$/exe can be read --- which.spec | 5 ++++- which2.sh | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/which.spec b/which.spec index 85af794..317c1e3 100644 --- a/which.spec +++ b/which.spec @@ -3,7 +3,7 @@ Summary: Displays where a particular program in your path is located Name: which Version: 2.23 -Release: 1%{?dist} +Release: 2%{?dist} License: GPL-3.0-only Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz Source1: which2.sh @@ -46,6 +46,9 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %{_mandir}/man1/which.1* %changelog +* Wed Jun 18 2025 Than Ngo - 2.23-2 +- Add a check to ensure that /proc/$$/exe can be read + * Mon Feb 03 2025 Than Ngo - 2.23-1 - Fixed rhbz#2343361, update to 2.23 diff --git a/which2.sh b/which2.sh index a7db49c..9829a06 100644 --- a/which2.sh +++ b/which2.sh @@ -1,7 +1,12 @@ # shellcheck shell=sh # Initialization script for bash, sh, mksh and ksh -case "$(basename $(readlink /proc/$$/exe))" in +if [ -r /proc/$$/exe ]; then + SHELLNAME=$(basename $(readlink /proc/$$/exe)) +else + SHELLNAME="unknown" +fi +case "$SHELLNAME" in *ksh*|zsh) alias which='alias | /usr/bin/which --tty-only --read-alias --show-tilde --show-dot' ;; From c68f9f566f6121338a25628ecea8ced339f087bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Mon, 7 Jul 2025 12:54:06 +0200 Subject: [PATCH 8/9] tests: migrate from STI to TMT Related: https://fedoraproject.org/wiki/Changes/DisableSTI --- .fmf/version | 1 + plans/ci.fmf | 5 + .../test.basic-functionality-test.log | 261 ------------------ tests/artifacts/test.log | 1 - tests/basic-functionality-test/main.fmf | 14 + tests/basic-functionality-test/runtest.sh | 1 - tests/tests.retry | 1 - tests/tests.yml | 13 - 8 files changed, 20 insertions(+), 277 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/ci.fmf delete mode 100644 tests/artifacts/test.basic-functionality-test.log delete mode 100644 tests/artifacts/test.log create mode 100644 tests/basic-functionality-test/main.fmf delete mode 100644 tests/tests.retry delete mode 100644 tests/tests.yml diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/ci.fmf b/plans/ci.fmf new file mode 100644 index 0000000..c1627f9 --- /dev/null +++ b/plans/ci.fmf @@ -0,0 +1,5 @@ +summary: Basic smoke test +discover: + how: fmf +execute: + how: tmt diff --git a/tests/artifacts/test.basic-functionality-test.log b/tests/artifacts/test.basic-functionality-test.log deleted file mode 100644 index 5c74efd..0000000 --- a/tests/artifacts/test.basic-functionality-test.log +++ /dev/null @@ -1,261 +0,0 @@ -posix on -:: [ 12:25:31 ] :: [ WARNING ] :: POSIX mode detected and switched off -:: [ 12:25:31 ] :: [ WARNING ] :: POSIX mode detected and switched off -:: [ 12:25:31 ] :: [ WARNING ] :: Please fix your test to have /bin/bash shebang -:: [ 12:25:31 ] :: [ WARNING ] :: Please fix your test to have /bin/bash shebang - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: Setup -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -which-2.21-4.fc27.x86_64 -:: [ PASS ] :: Checking for the presence of which rpm -:: [ 12:25:31 ] :: Package versions: -:: [ 12:25:31 ] :: Package versions: -:: [ 12:25:31 ] :: which-2.21-4.fc27.x86_64 -:: [ 12:25:31 ] :: which-2.21-4.fc27.x86_64 -:: [ BEGIN ] :: Creating tmp directory :: actually running 'TmpDir=$(mktemp -d)' -:: [ BEGIN ] :: Creating tmp directory :: actually running 'TmpDir=$(mktemp -d)' -:: [ PASS ] :: Creating tmp directory (Expected 0, got 0) -:: [ BEGIN ] :: Running 'pushd /tmp/tmp.cVaYqMMJWL' -:: [ BEGIN ] :: Running 'pushd /tmp/tmp.cVaYqMMJWL' -/tmp/tmp.cVaYqMMJWL /usr/local/bin/basic-functionality-test -:: [ PASS ] :: Command 'pushd /tmp/tmp.cVaYqMMJWL' (Expected 0, got 0) -:: [ BEGIN ] :: Running 'cp -p /bin/true /tmp/tmp.cVaYqMMJWL' -:: [ BEGIN ] :: Running 'cp -p /bin/true /tmp/tmp.cVaYqMMJWL' -:: [ PASS ] :: Command 'cp -p /bin/true /tmp/tmp.cVaYqMMJWL' (Expected 0, got 0) - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: test --version -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ BEGIN ] :: Running 'VERSION=$( rpm -q --qf '%{VERSION}' which )' -:: [ BEGIN ] :: Running 'VERSION=$( rpm -q --qf '%{VERSION}' which )' -:: [ PASS ] :: Command 'VERSION=$( rpm -q --qf '%{VERSION}' which )' (Expected 0, got 0) -:: [ BEGIN ] :: Running 'which --version' -:: [ BEGIN ] :: Running 'which --version' -GNU which v2.21, Copyright (C) 1999 - 2015 Carlo Wood. -GNU which comes with ABSOLUTELY NO WARRANTY; -This program is free software; your freedom to use, change -and distribute this program is protected by the GPL. -:: [ PASS ] :: Command 'which --version' (Expected 0, got 0) -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.0WBy8LPp' should contain 'GNU which v2.21' - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: test locating the bash binary -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ BEGIN ] :: Running 'which bash' -:: [ BEGIN ] :: Running 'which bash' -/bin/bash -:: [ PASS ] :: Command 'which bash' (Expected 0, got 0) -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.eBwKSEjp' should contain '/bin/bash' - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: test an alias -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ BEGIN ] :: Running 'echo 'alias foo=bar' > bashrc' -:: [ BEGIN ] :: Running 'echo 'alias foo=bar' > bashrc' -:: [ PASS ] :: Command 'echo 'alias foo=bar' > bashrc' (Expected 0, got 0) -:: [ BEGIN ] :: Running 'echo -e 'alias foo=true -which foo' | bash -i' -:: [ BEGIN ] :: Running 'echo -e 'alias foo=true -which foo' | bash -i' -[root@localhost tmp.cVaYqMMJWL]# alias foo=true -[root@localhost tmp.cVaYqMMJWL]# which foo -]0;root@localhost:/tmp/tmp.cVaYqMMJWL]0;root@localhost:/tmp/tmp.cVaYqMMJWLalias foo='true' - /bin/true -[root@localhost tmp.cVaYqMMJWL]# exit -]0;root@localhost:/tmp/tmp.cVaYqMMJWL:: [ PASS ] :: Command 'echo -e 'alias foo=true\nwhich foo' | bash -i' (Expected 0, got 0) -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.W7TNYyLv' should contain 'alias foo='true'' -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.W7TNYyLv' should contain '/bin/true' - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: test non existing command -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ BEGIN ] :: Running 'which foobar' -:: [ BEGIN ] :: Running 'which foobar' -which: no foobar in (/sbin:/bin:/usr/sbin:/usr/bin) -:: [ PASS ] :: Command 'which foobar' (Expected 1, got 1) -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.qmmfZVfo' should contain 'no foobar in (/sbin:/bin:/usr/sbin:/usr/bin)' - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: test with customized PATH -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ BEGIN ] :: Running 'bash -c 'export PATH=/tmp/tmp.cVaYqMMJWL:/sbin:/bin:/usr/sbin:/usr/bin; which true'' -:: [ BEGIN ] :: Running 'bash -c 'export PATH=/tmp/tmp.cVaYqMMJWL:/sbin:/bin:/usr/sbin:/usr/bin; which true'' -/tmp/tmp.cVaYqMMJWL/true -:: [ PASS ] :: Command 'bash -c 'export PATH=/tmp/tmp.cVaYqMMJWL:/sbin:/bin:/usr/sbin:/usr/bin; which true'' (Expected 0, got 0) -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.1ondAtov' should contain '/tmp/tmp.cVaYqMMJWL/true' - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: test options -a / --all -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ BEGIN ] :: Running 'bash -c 'export PATH=/tmp/tmp.cVaYqMMJWL:/sbin:/bin:/usr/sbin:/usr/bin; which -a true'' -:: [ BEGIN ] :: Running 'bash -c 'export PATH=/tmp/tmp.cVaYqMMJWL:/sbin:/bin:/usr/sbin:/usr/bin; which -a true'' -/tmp/tmp.cVaYqMMJWL/true -/bin/true -/usr/bin/true -:: [ PASS ] :: Command 'bash -c 'export PATH=/tmp/tmp.cVaYqMMJWL:/sbin:/bin:/usr/sbin:/usr/bin; which -a true'' (Expected 0, got 0) -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.9pOxwvyK' should contain '/tmp/tmp.cVaYqMMJWL/true' -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.9pOxwvyK' should contain '/bin/true' -:: [ BEGIN ] :: Running 'bash -c 'export PATH=/tmp/tmp.cVaYqMMJWL:/sbin:/bin:/usr/sbin:/usr/bin; which --all true'' -:: [ BEGIN ] :: Running 'bash -c 'export PATH=/tmp/tmp.cVaYqMMJWL:/sbin:/bin:/usr/sbin:/usr/bin; which --all true'' -/tmp/tmp.cVaYqMMJWL/true -/bin/true -/usr/bin/true -:: [ PASS ] :: Command 'bash -c 'export PATH=/tmp/tmp.cVaYqMMJWL:/sbin:/bin:/usr/sbin:/usr/bin; which --all true'' (Expected 0, got 0) -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.SMe8bSin' should contain '/tmp/tmp.cVaYqMMJWL/true' -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.SMe8bSin' should contain '/bin/true' - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: Cleanup -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ BEGIN ] :: Running 'popd' -:: [ BEGIN ] :: Running 'popd' -/usr/local/bin/basic-functionality-test -:: [ PASS ] :: Command 'popd' (Expected 0, got 0) -:: [ BEGIN ] :: Removing tmp directory :: actually running 'rm -r /tmp/tmp.cVaYqMMJWL' -:: [ BEGIN ] :: Removing tmp directory :: actually running 'rm -r /tmp/tmp.cVaYqMMJWL' -:: [ PASS ] :: Removing tmp directory (Expected 0, got 0) - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: TEST PROTOCOL -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ LOG ] :: Package : unknown -:: [ LOG ] :: Installed : which-2.21-4.fc27.x86_64 -:: [ LOG ] :: beakerlib RPM : beakerlib-1.16-4.fc27 -:: [ LOG ] :: bl-redhat RPM : not installed -:: [ LOG ] :: Test started : 2017-12-11 12:25:31 EET -:: [ LOG ] :: Test finished : 2017-12-11 12:25:34 EET -:: [ LOG ] :: Test name : basic-functionality-test -:: [ LOG ] :: Distro : Fedora release 27 (Twenty Seven) -:: [ LOG ] :: Hostname : localhost.localdomain -:: [ LOG ] :: Architecture : x86_64 - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: Test description -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -PURPOSE of /CoreOS/which/Sanity/basic-functionality-test -Description: tests basic functionality -Author: Karel Srot - -tests following scenarios: - * test --version - * test locating the bash binary - * test an alias - * test non existing command - * test with customized PATH - * test options -a / --all - -:: [ WARNING ] :: POSIX mode detected and switched off -:: [ WARNING ] :: Please fix your test to have /bin/bash shebang - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: Setup -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ PASS ] :: Checking for the presence of which rpm -:: [ LOG ] :: Package versions: -:: [ LOG ] :: which-2.21-4.fc27.x86_64 -:: [ PASS ] :: Creating tmp directory (Expected 0, got 0) -:: [ PASS ] :: Command 'pushd /tmp/tmp.cVaYqMMJWL' (Expected 0, got 0) -:: [ PASS ] :: Command 'cp -p /bin/true /tmp/tmp.cVaYqMMJWL' (Expected 0, got 0) -:: [ LOG ] :: Duration: 1s -:: [ LOG ] :: Assertions: 4 good, 0 bad -:: [ PASS ] :: RESULT: Setup - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: test --version -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ PASS ] :: Command 'VERSION=$( rpm -q --qf '%{VERSION}' which )' (Expected 0, got 0) -:: [ PASS ] :: Command 'which --version' (Expected 0, got 0) -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.0WBy8LPp' should contain 'GNU which v2.21' -:: [ LOG ] :: Duration: 0s -:: [ LOG ] :: Assertions: 3 good, 0 bad -:: [ PASS ] :: RESULT: test --version - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: test locating the bash binary -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ PASS ] :: Command 'which bash' (Expected 0, got 0) -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.eBwKSEjp' should contain '/bin/bash' -:: [ LOG ] :: Duration: 0s -:: [ LOG ] :: Assertions: 2 good, 0 bad -:: [ PASS ] :: RESULT: test locating the bash binary - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: test an alias -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ PASS ] :: Command 'echo 'alias foo=bar' > bashrc' (Expected 0, got 0) -:: [ PASS ] :: Command 'echo -e 'alias foo=true\nwhich foo' | bash -i' (Expected 0, got 0) -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.W7TNYyLv' should contain 'alias foo='true'' -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.W7TNYyLv' should contain '/bin/true' -:: [ LOG ] :: Duration: 0s -:: [ LOG ] :: Assertions: 4 good, 0 bad -:: [ PASS ] :: RESULT: test an alias - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: test non existing command -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ PASS ] :: Command 'which foobar' (Expected 1, got 1) -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.qmmfZVfo' should contain 'no foobar in (/sbin:/bin:/usr/sbin:/usr/bin)' -:: [ LOG ] :: Duration: 0s -:: [ LOG ] :: Assertions: 2 good, 0 bad -:: [ PASS ] :: RESULT: test non existing command - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: test with customized PATH -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ PASS ] :: Command 'bash -c 'export PATH=/tmp/tmp.cVaYqMMJWL:/sbin:/bin:/usr/sbin:/usr/bin; which true'' (Expected 0, got 0) -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.1ondAtov' should contain '/tmp/tmp.cVaYqMMJWL/true' -:: [ LOG ] :: Duration: 0s -:: [ LOG ] :: Assertions: 2 good, 0 bad -:: [ PASS ] :: RESULT: test with customized PATH - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: test options -a / --all -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ PASS ] :: Command 'bash -c 'export PATH=/tmp/tmp.cVaYqMMJWL:/sbin:/bin:/usr/sbin:/usr/bin; which -a true'' (Expected 0, got 0) -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.9pOxwvyK' should contain '/tmp/tmp.cVaYqMMJWL/true' -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.9pOxwvyK' should contain '/bin/true' -:: [ PASS ] :: Command 'bash -c 'export PATH=/tmp/tmp.cVaYqMMJWL:/sbin:/bin:/usr/sbin:/usr/bin; which --all true'' (Expected 0, got 0) -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.SMe8bSin' should contain '/tmp/tmp.cVaYqMMJWL/true' -:: [ PASS ] :: File '/var/tmp/rlRun_LOG.SMe8bSin' should contain '/bin/true' -:: [ LOG ] :: Duration: 1s -:: [ LOG ] :: Assertions: 6 good, 0 bad -:: [ PASS ] :: RESULT: test options -a / --all - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: Cleanup -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ PASS ] :: Command 'popd' (Expected 0, got 0) -:: [ PASS ] :: Removing tmp directory (Expected 0, got 0) -:: [ LOG ] :: Duration: 0s -:: [ LOG ] :: Assertions: 2 good, 0 bad -:: [ PASS ] :: RESULT: Cleanup - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: [ LOG ] :: basic-functionality-test -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: [ LOG ] :: Phases: 8 good, 0 bad -:: [ PASS ] :: RESULT: basic-functionality-test -:: [ 12:25:34 ] :: JOURNAL XML: /var/tmp/beakerlib-3xyUzEH/journal.xml -:: [ 12:25:34 ] :: JOURNAL XML: /var/tmp/beakerlib-3xyUzEH/journal.xml -:: [ 12:25:34 ] :: JOURNAL TXT: /var/tmp/beakerlib-3xyUzEH/journal.txt -:: [ 12:25:34 ] :: JOURNAL TXT: /var/tmp/beakerlib-3xyUzEH/journal.txt diff --git a/tests/artifacts/test.log b/tests/artifacts/test.log deleted file mode 100644 index efaf4f6..0000000 --- a/tests/artifacts/test.log +++ /dev/null @@ -1 +0,0 @@ -PASS basic-functionality-test diff --git a/tests/basic-functionality-test/main.fmf b/tests/basic-functionality-test/main.fmf new file mode 100644 index 0000000..5c98a29 --- /dev/null +++ b/tests/basic-functionality-test/main.fmf @@ -0,0 +1,14 @@ +summary: tests basic functionality +description: "tests following scenarios:\n * test --version\n * test locating the + bash binary\n * test an alias\n * test non existing command\n * test with customized + PATH\n * test options -a / --all\n" +contact: Karel Srot +component: + - which +test: ./runtest.sh +framework: beakerlib +recommend: + - which +duration: 5m +extra-summary: /CoreOS/which/Sanity/basic-functionality-test +extra-task: /CoreOS/which/Sanity/basic-functionality-test diff --git a/tests/basic-functionality-test/runtest.sh b/tests/basic-functionality-test/runtest.sh index d46f002..c33c1c6 100755 --- a/tests/basic-functionality-test/runtest.sh +++ b/tests/basic-functionality-test/runtest.sh @@ -27,7 +27,6 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Include Beaker environment -. /usr/bin/rhts-environment.sh || exit 1 . /usr/share/beakerlib/beakerlib.sh || exit 1 PACKAGE="which" diff --git a/tests/tests.retry b/tests/tests.retry deleted file mode 100644 index 2fbb50c..0000000 --- a/tests/tests.retry +++ /dev/null @@ -1 +0,0 @@ -localhost diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index b5b96d8..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -# Run tests in all contexts -- hosts: localhost - tags: - - classic - - container - - atomic - roles: - - role: standard-test-beakerlib - tests: - - basic-functionality-test - required_packages: - - which From ac38d264ed7d568632294389b9245f4272156986 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 20:24:07 +0000 Subject: [PATCH 9/9] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- which.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/which.spec b/which.spec index 317c1e3..7174222 100644 --- a/which.spec +++ b/which.spec @@ -3,7 +3,7 @@ Summary: Displays where a particular program in your path is located Name: which Version: 2.23 -Release: 2%{?dist} +Release: 3%{?dist} License: GPL-3.0-only Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz Source1: which2.sh @@ -46,6 +46,9 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %{_mandir}/man1/which.1* %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 2.23-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Wed Jun 18 2025 Than Ngo - 2.23-2 - Add a check to ensure that /proc/$$/exe can be read