From 8e7a42bbb46673f9b0eb05a7d41b93e958925e6f Mon Sep 17 00:00:00 2001 From: Petr Menšík Date: Jan 18 2021 09:44:26 +0000 Subject: Do not fail unit tests under new bash 5.1 --- diff --git a/bmake-unit-tests-var-op-shell.patch b/bmake-unit-tests-var-op-shell.patch new file mode 100644 index 0000000..5948d1f --- /dev/null +++ b/bmake-unit-tests-var-op-shell.patch @@ -0,0 +1,28 @@ +From 691154320a1a4c77805a57d298a0b8d6e823eb29 Mon Sep 17 00:00:00 2001 +From: Petr Mensik +Date: Mon, 18 Jan 2021 10:39:46 +0100 +Subject: [PATCH] Support bash 5.1 + +New bash adds to output line 1: after shell name. That made var-op-shell +unit test fail under bash 5.1.0. Allow it to pass by cutting line X away +from var-op-shell. +--- + unit-tests/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/unit-tests/Makefile b/unit-tests/Makefile +index 87ed4ef..626ba44 100644 +--- a/unit-tests/Makefile ++++ b/unit-tests/Makefile +@@ -507,7 +507,7 @@ SED_CMDS.suff-main+= ${STD_SED_CMDS.dg1} + SED_CMDS.suff-main-several+= ${STD_SED_CMDS.dg1} + SED_CMDS.suff-transform-debug+= ${STD_SED_CMDS.dg1} + SED_CMDS.var-op-shell+= \ +- -e 's,^${.SHELL:T}: [ 0-9:]*,,' \ ++ -e 's,^${.SHELL:T}: \(line \)\?[ 0-9:]*,,' \ + -e 's,^${.SHELL:T}: ,,' \ + -e '/command/s,No such.*,not found,' + SED_CMDS.vardebug+= -e 's,${.SHELL},,' +-- +2.26.2 + diff --git a/bmake.spec b/bmake.spec index 3172739..d5b3059 100644 --- a/bmake.spec +++ b/bmake.spec @@ -7,6 +7,8 @@ URL: https://ftp.netbsd.org/pub/NetBSD/misc/sjg/ Source0: %{url}/bmake-%{version}.tar.gz Requires: mk-files +Patch1: bmake-unit-tests-var-op-shell.patch + BuildRequires: gcc BuildRequires: sed BuildRequires: util-linux @@ -34,7 +36,7 @@ build all kinds of targets, including, for example, C/C++ programs and/or shared libraries. %prep -%autosetup -n %{name} +%autosetup -n %{name} -p1 sed -i.timestamp -e 's|cp_f=-f|cp_f=-pf|' mk/install-mk sed -i.python -e '1 s|^#!/usr/bin/env python|#!/usr/bin/python3|' mk/meta2deps.py