From patchwork Thu Mar 13 22:14:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 77 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (caibbdcaaahc.dreamhost.com [208.113.200.72]) by wilcox.dreamhost.com (Postfix) with ESMTP id 042D3360175 for ; Thu, 13 Mar 2014 15:14:16 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14307373) id A6C5340F88D28; Thu, 13 Mar 2014 15:14:16 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx20.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id 7A134408017B4 for ; Thu, 13 Mar 2014 15:14:16 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding:content-type; q=dns; s=default; b=O36alkX1lzrx2mkE7KfJ49ySSRsmma0RV/1TwKR+Xpv fumbF4gq0gRSaGsmgEoFbhfmh5eFN1i5OeUi/DcddUtbzw5dhXtzBNFx7q50k5q5 SD+slK+Kwy/JvwMMs/G0C92gvkFwOhqCwDsVzY0wqVlsxbn5JO8vzIs7TCChIhEY = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding:content-type; s=default; bh=LR0x2Eugz0E5icMOGuWR61WCVBg=; b=hAI/qQA3DRDillxgZ PaxDzsnIOXIuFbFkQzbtQ1cIGfFqLfORnPR9xeMArQ31aIpsWp370NqlRLeEM9X0 K29h7YQBzixq9qSKV0NNOr0Nkej6SPMK66BE+a8NXUMZZeKy0YFqus8l2BEwnQrf KHcCsxRADD9q8dRgyyh+y3udy8= Received: (qmail 17216 invoked by alias); 13 Mar 2014 22:14:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 17207 invoked by uid 89); 13 Mar 2014 22:14:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org From: Mike Frysinger To: libc-alpha@sourceware.org Subject: Re: [PATCH v2] sotruss: convert from ksh to bash Date: Thu, 13 Mar 2014 18:14:14 -0400 Message-ID: <1513046.Pq6yaohzbx@vapier> User-Agent: KMail/4.12.3 (Linux/3.13.0; KDE/4.12.3; x86_64; ; ) In-Reply-To: <11174511.vyN9KHlfPq@vapier> References: <1390644580-25234-1-git-send-email-vapier@gentoo.org> <2683351.sTNi7IfGEu@vapier> <11174511.vyN9KHlfPq@vapier> MIME-Version: 1.0 X-DH-Original-To: glibc@patchwork.siddhesh.in This script works fine under bash (which we already require), so tweak the code to be pure bash. Signed-off-by: Mike Frysinger 2014-01-23 Mike Frysinger * elf/Makefile: Delete $(have-ksh) check. ($(objpfx)sotruss): Change KSH to BASH. * elf/sotruss.ksh: Rename to ... * elf/sotruss.sh: ... this. Change @KSH@ to @BASH@. Change function style to match bash. --- elf/Makefile | 6 +++--- elf/{sotruss.ksh => sotruss.sh} | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) rename elf/{sotruss.ksh => sotruss.sh} (98%) diff --git a/elf/Makefile b/elf/Makefile index 2db3c98..8abc60b 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -93,7 +93,7 @@ pldd-modules := xmalloc # To find xmalloc.c and xstrdup.c vpath %.c ../locale/programs -ifeq ($(have-ksh)$(build-shared),yesyes) +ifeq ($(build-shared),yes) extra-objs += sotruss-lib.os sotruss-lib.so install-others += $(inst_auditdir)/sotruss-lib.so install-bin-script += sotruss @@ -104,8 +104,8 @@ $(objpfx)sotruss-lib.so: $(objpfx)sotruss-lib.os $(objpfx)sotruss-lib.so: $(common-objpfx)libc.so $(objpfx)ld.so \ $(common-objpfx)libc_nonshared.a -$(objpfx)sotruss: sotruss.ksh $(common-objpfx)config.make - sed -e 's%@KSH@%$(KSH)%g' \ +$(objpfx)sotruss: sotruss.sh $(common-objpfx)config.make + sed -e 's%@BASH@%$(BASH)%g' \ -e 's%@VERSION@%$(version)%g' \ -e 's%@TEXTDOMAINDIR@%$(msgcatdir)%g' \ -e 's%@PREFIX@%$(prefix)%g' \ diff --git a/elf/sotruss.ksh b/elf/sotruss.sh similarity index 98% rename from elf/sotruss.ksh rename to elf/sotruss.sh index 371a70b..a408b58 100755 --- a/elf/sotruss.ksh +++ b/elf/sotruss.sh @@ -1,4 +1,4 @@ -#! @KSH@ +#! @BASH@ # Copyright (C) 2011-2014 Free Software Foundation, Inc. # This file is part of the GNU C Library. @@ -28,7 +28,7 @@ unset SOTRUSS_NOINDENT SOTRUSS_WHICH=$$ lib='@PREFIX@/$LIB/audit/sotruss-lib.so' -function do_help { +do_help() { echo $"Usage: sotruss [OPTION...] [--] EXECUTABLE [EXECUTABLE-OPTION...] -F, --from FROMLIST Trace calls from objects on FROMLIST -T, --to TOLIST Trace calls to objects on TOLIST @@ -51,13 +51,13 @@ function do_help { exit 0 } -function do_missing_arg { +do_missing_arg() { printf >&2 $"%s: option requires an argument -- '%s'\n" sotruss "$1" printf >&2 $"Try \`%s --help' or \`%s --usage' for more information.\n" sotruss sotruss exit 1 } -function do_ambiguous { +do_ambiguous() { printf >&2 $"%s: option is ambiguous; possibilities:" while test $# -gt 0; do printf >&2 " '%s'" $1