source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: mandoc: do not use the sed(1) -i option, it is not portable; issue found
Date: Sun, 19 Sep 2021 07:16:04 -0500 (EST)	[thread overview]
Message-ID: <c2aac8f08e5ca685@mandoc.bsd.lv> (raw)

Log Message:
-----------
do not use the sed(1) -i option, it is not portable;
issue found on Oracle Solaris 11

Modified Files:
--------------
    mandoc/regress:
        regress.pl

Revision Data
-------------
Index: regress.pl
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/regress.pl,v
retrieving revision 1.15
retrieving revision 1.16
diff -Lregress/regress.pl -Lregress/regress.pl -u -p -r1.15 -r1.16
--- regress/regress.pl
+++ regress/regress.pl
@@ -2,7 +2,7 @@
 #
 # $Id$
 #
-# Copyright (c) 2017, 2018, 2019, 2020 Ingo Schwarze <schwarze@openbsd.org>
+# Copyright (c) 2017,2018,2019,2020,2021 Ingo Schwarze <schwarze@openbsd.org>
 #
 # Permission to use, copy, modify, and distribute this software for any
 # purpose with or without fee is hereby granted, provided that the above
@@ -261,6 +261,7 @@ for my $test (@regress_tests) {
 	my $o = "$test->{NAME}.mandoc_ascii";
 	my $w = "$test->{NAME}.out_ascii";
 	my $to = "$test->{NAME}.mandoc_tag";
+	my $tos = "$test->{NAME}.mandoc_tag_s";
 	my $tw = "$test->{NAME}.out_tag";
 	my $diff_ascii;
 	if ($targets{tag} && $tag_tests{$test->{NAME}} &&
@@ -273,8 +274,8 @@ for my $test (@regress_tests) {
 		print "@cmd\n" if $targets{verbose};
 		system @cmd
 		    and fail $test->{NAME}, 'tag:man';
-		system qw(sed -i), 's/ .*\// /', $to;
-		system @diff, $tw, $to
+		system "sed 's: .*/: :' $to > $tos";
+		system @diff, $tw, $tos
 		    and fail $test->{NAME}, 'tag:diff';
 		print "." unless $targets{verbose};
 		$diff_ascii = $targets{ascii};
@@ -309,8 +310,8 @@ for my $test (@regress_tests) {
 		print "." unless $targets{verbose};
 	}
 	if ($targets{clean}) {
-		print "rm $o $to $m $mo\n" if $targets{verbose};
-		$count_rm += unlink $o, $to, $m, $mo;
+		print "rm $o $to $tos $m $mo\n" if $targets{verbose};
+		$count_rm += unlink $o, $to, $tos, $m, $mo;
 	}
 }
 if ($targets{ascii} || $targets{tag} || $targets{man}) {
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv


                 reply	other threads:[~2021-09-19 12:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c2aac8f08e5ca685@mandoc.bsd.lv \
    --to=schwarze@mandoc.bsd.lv \
    --cc=source@mandoc.bsd.lv \
    --subject='Re: mandoc: do not use the sed(1) -i option, it is not portable; issue found' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).