Patchwork D8500: tests: use regular POSIX shell

login
register
mail settings
Submitter phabricator
Date May 7, 2020, 1:03 p.m.
Message ID <differential-rev-PHID-DREV-ckk6yrtv66kejkiiznme-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46266/
State Superseded
Headers show

Comments

phabricator - May 7, 2020, 1:03 p.m.
joerg.sonnenberger created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  wait-on-file requires one POSIX extension (sleep with non-integral
  argument), but it doesn't require any bash extensions, so just require a
  normal POSIX shell. While here, use consistent formatting without
  redundant ;

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D8500

AFFECTED FILES
  tests/testlib/wait-on-file

CHANGE DETAILS




To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/testlib/wait-on-file b/tests/testlib/wait-on-file
--- a/tests/testlib/wait-on-file
+++ b/tests/testlib/wait-on-file
@@ -1,4 +1,4 @@ 
-#!/bin/bash
+#!/bin/sh
 #
 # wait up to TIMEOUT seconds until a WAIT_ON_FILE is created.
 #
@@ -22,13 +22,11 @@ 
     create="$3"
 fi
 
-if [ -n "$create" ];
-then
+if [ -n "$create" ]; then
     touch "$create"
     create=""
 fi
-while [ "$timer" -gt 0 ] && [ ! -f "$wait_on" ];
-do
+while [ "$timer" -gt 0 ] && [ ! -f "$wait_on" ]; do
     timer=$(( $timer - 1))
     sleep 0.01
 done