unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: unicorn-public@bogomips.org
Cc: Jeremy Evans <code@jeremyevans.net>
Subject: [PATCH] test-lib: expr(1) portability fix
Date: Fri, 10 Mar 2017 21:51:02 +0000	[thread overview]
Message-ID: <20170310215102.GA25161@plume> (raw)

GNU expr supports '+' to match one or more occurrences, but
it seems the expr(1) on my FreeBSD installation does not.
 This only covers the Bourne sh integration tests in t/

 I still don't trust the Ruby language (and test libraries
 written in it) to not change incompatibility after all these years...

 t/test-lib.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 28d6a88..7f97958 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -106,8 +106,8 @@ check_stderr () {
 # unicorn_setup
 unicorn_setup () {
 	eval $(unused_listen)
-	port=$(expr $listen : '[^:]*:\([0-9]\+\)')
-	host=$(expr $listen : '\([^:]*\):[0-9]\+')
+	port=$(expr $listen : '[^:]*:\([0-9]*\)')
+	host=$(expr $listen : '\([^:][^:]*\):[0-9][0-9]*')
 	rtmpfiles unicorn_config pid r_err r_out fifo tmp ok
 	cat > $unicorn_config <<EOF

                 reply	other threads:[~2017-03-10 21:51 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:

  List information: https://yhbt.net/unicorn/

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

  git send-email \
    --in-reply-to=20170310215102.GA25161@plume \
    --to=e@80x24.org \
    --cc=code@jeremyevans.net \
    --cc=unicorn-public@bogomips.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


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 read-only IMAP folder(s) and NNTP newsgroup(s).