From owner-svn-src-stable@freebsd.org Fri Jul 17 06:53:04 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38F2935AB80; Fri, 17 Jul 2020 06:53:04 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B7MJc0ng4z4dJf; Fri, 17 Jul 2020 06:53:04 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F28121554B; Fri, 17 Jul 2020 06:53:03 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06H6r3GA068034; Fri, 17 Jul 2020 06:53:03 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06H6r3YN068033; Fri, 17 Jul 2020 06:53:03 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202007170653.06H6r3YN068033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Fri, 17 Jul 2020 06:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363270 - stable/11/usr.bin/xinstall/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/usr.bin/xinstall/tests X-SVN-Commit-Revision: 363270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2020 06:53:04 -0000 Author: eugen Date: Fri Jul 17 06:53:03 2020 New Revision: 363270 URL: https://svnweb.freebsd.org/changeset/base/363270 Log: MFC r363088: fix tests for install(1): add support for STRIPBIN's -o option. Modified: stable/11/usr.bin/xinstall/tests/install_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/xinstall/tests/install_test.sh ============================================================================== --- stable/11/usr.bin/xinstall/tests/install_test.sh Fri Jul 17 06:52:03 2020 (r363269) +++ stable/11/usr.bin/xinstall/tests/install_test.sh Fri Jul 17 06:53:03 2020 (r363270) @@ -186,8 +186,12 @@ overwrite_backup_safe_comparing_body() { setup_stripbin() { cat <<\STRIPBIN >stripbin #!/bin/sh -tr z @ <"$1" >"$1.new" && mv -- "$1.new" "$1" +[ "$1" = "-o" ] && dst="$2" && shift 2 +[ "$1" = "--" ] && shift +[ -z "$dst" ] && dst="$1" STRIPBIN + [ "$1" = "true" ] && cmd="cat" || cmd="tr z @" + echo $cmd '<"$1" >"$1.new" && mv -- "$1.new" "$dst"' >>stripbin chmod 755 stripbin export STRIPBIN="$PWD/stripbin" } @@ -253,7 +257,7 @@ strip_changing_overwrite_eq_comparing_body() { atf_test_case strip_noop strip_noop_body() { - export STRIPBIN=true + setup_stripbin true printf 'test\n123\r456\r\n789\0z' >testf atf_check install -s testf copyf [ ! testf -nt copyf ] || atf_fail "bad timestamp"