From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff King Subject: [PATCH 5/9] t/lib-httpd: use write_script to copy CGI scripts Date: Wed, 21 May 2014 06:29:42 -0400 Message-ID: <20140521102941.GE30464@sigill.intra.peff.net> References: <20140521102524.GA30301@sigill.intra.peff.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: "Kyle J. McKay" To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Wed May 21 12:29:57 2014 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wn3mQ-0000ht-Ux for gcvg-git-2@plane.gmane.org; Wed, 21 May 2014 12:29:51 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752244AbaEUK3q (ORCPT ); Wed, 21 May 2014 06:29:46 -0400 Received: from cloud.peff.net ([50.56.180.127]:56413 "HELO peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752229AbaEUK3n (ORCPT ); Wed, 21 May 2014 06:29:43 -0400 Received: (qmail 32508 invoked by uid 102); 21 May 2014 10:29:44 -0000 Received: from c-71-63-4-13.hsd1.va.comcast.net (HELO sigill.intra.peff.net) (71.63.4.13) (smtp-auth username relayok, mechanism cram-md5) by peff.net (qpsmtpd/0.84) with ESMTPA; Wed, 21 May 2014 05:29:44 -0500 Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Wed, 21 May 2014 06:29:42 -0400 Content-Disposition: inline In-Reply-To: <20140521102524.GA30301@sigill.intra.peff.net> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Using write_script will set our shebang line appropriately with $SHELL_PATH. The script that is there now is quite simple and likely to succeed even with a non-POSIX /bin/sh, but it does not hurt to be defensive. Signed-off-by: Jeff King --- t/lib-httpd.sh | 6 +++++- t/lib-httpd/broken-smart-http.sh | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) mode change 100755 => 100644 t/lib-httpd/broken-smart-http.sh diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh index 252cbf1..8e680ef 100644 --- a/t/lib-httpd.sh +++ b/t/lib-httpd.sh @@ -105,10 +105,14 @@ else "Could not identify web server at '$LIB_HTTPD_PATH'" fi +install_script () { + write_script "$HTTPD_ROOT_PATH/$1" <"$TEST_PATH/$1" +} + prepare_httpd() { mkdir -p "$HTTPD_DOCUMENT_ROOT_PATH" cp "$TEST_PATH"/passwd "$HTTPD_ROOT_PATH" - cp "$TEST_PATH"/broken-smart-http.sh "$HTTPD_ROOT_PATH" + install_script broken-smart-http.sh ln -s "$LIB_HTTPD_MODULE_PATH" "$HTTPD_ROOT_PATH/modules" diff --git a/t/lib-httpd/broken-smart-http.sh b/t/lib-httpd/broken-smart-http.sh old mode 100755 new mode 100644 index f7ebfff..82cc610 --- a/t/lib-httpd/broken-smart-http.sh +++ b/t/lib-httpd/broken-smart-http.sh @@ -1,4 +1,3 @@ -#!/bin/sh printf "Content-Type: text/%s\n" "html" echo printf "%s\n" "001e# service=git-upload-pack" -- 2.0.0.rc1.436.g03cb729