Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Jul 2020 22:59:26 +0000 (UTC)
From:      Eugene Grosbein <eugen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r363088 - head/usr.bin/xinstall/tests
Message-ID:  <202007102259.06AMxQxA013750@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eugen
Date: Fri Jul 10 22:59:26 2020
New Revision: 363088
URL: https://svnweb.freebsd.org/changeset/base/363088

Log:
  Fix the tests for install(1): add support for STRIPBIN's -o option.
  
  Reported by:	lwhsu
  MFC after:	1 week

Modified:
  head/usr.bin/xinstall/tests/install_test.sh

Modified: head/usr.bin/xinstall/tests/install_test.sh
==============================================================================
--- head/usr.bin/xinstall/tests/install_test.sh	Fri Jul 10 21:41:09 2020	(r363087)
+++ head/usr.bin/xinstall/tests/install_test.sh	Fri Jul 10 22:59:26 2020	(r363088)
@@ -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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007102259.06AMxQxA013750>