From patchwork Fri Oct 28 14:33:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 9402049 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EC63360588 for ; Fri, 28 Oct 2016 14:35:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA45228E51 for ; Fri, 28 Oct 2016 14:35:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA0022A0FA; Fri, 28 Oct 2016 14:35:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6115B28E51 for ; Fri, 28 Oct 2016 14:35:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c08E2-0006ax-OC; Fri, 28 Oct 2016 14:33:42 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c08E1-0006ar-N7 for xen-devel@lists.xenproject.org; Fri, 28 Oct 2016 14:33:41 +0000 Received: from [85.158.143.35] by server-11.bemta-6.messagelabs.com id B9/17-14466-5C163185; Fri, 28 Oct 2016 14:33:41 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDIsWRWlGSWpSXmKPExsWyU9JRQvdIonC EwZQHihbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8aap/cZC5YIVfQ+NmtgvM7fxcjJISHgJ7H6 7jY2EJtNQEfi4tydQDYHh4iAisTtvQZdjFwczAKHGSXO3XjIDlIjLGAq0f/jFiOIzSKgKtF67 jiYzSvgLDH16zwWiJm6Eg/P/WaFiAtKnJz5BCzOLKAp0br9NzuELS/RvHU2M4gtJKAo0T/vAR tEb7rExGc9UHO4JVZ+/sMygZFvFpJRs5CMmoVk1AJG5lWMGsWpRWWpRbpGhnpJRZnpGSW5iZk 5uoYGZnq5qcXFiempOYlJxXrJ+bmbGIGhxgAEOxj/LAs4xCjJwaQkyvshXDhCiC8pP6UyI7E4 I76oNCe1+BCjDAeHkgTvjASgnGBRanpqRVpmDjDoYdISHDxKIryX44HSvMUFibnFmekQqVOMi lLivKdA+gRAEhmleXBtsEi7xCgrJczLCHSIEE9BalFuZgmq/CtGcQ5GJWHeWJApPJl5JXDTXw EtZgJaPD1dAGRxSSJCSqqBUanFMNdzc5Cr6GKBTz90bu93KKvJSp0Uue3ElknHW3i44lP7jiT 1flXJvTZju4zaucKzayexF+4Nb1lmnndIrF7GaPucp3yrk9Z9yDvKp/RsZyNXkFLrj08L50id 0jSefy1afL/11Tv3Z0zLZM/MWuS8+06q+d+eFwkHlkXcXbp1t+HfGduntSqxFGckGmoxFxUnA gC+Oc8DrwIAAA== X-Env-Sender: prvs=1024b7921=roger.pau@citrix.com X-Msg-Ref: server-9.tower-21.messagelabs.com!1477665220!40430188!1 X-Originating-IP: [185.25.65.24] X-SpamReason: No, hits=0.0 required=7.0 tests=received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.0.13; banners=-,-,- X-VirusChecked: Checked Received: (qmail 53546 invoked from network); 28 Oct 2016 14:33:40 -0000 Received: from smtp.ctxuk.citrix.com (HELO SMTP.EU.CITRIX.COM) (185.25.65.24) by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 28 Oct 2016 14:33:40 -0000 X-IronPort-AV: E=Sophos;i="5.31,410,1473120000"; d="scan'208";a="33908630" From: Roger Pau Monne To: Date: Fri, 28 Oct 2016 16:33:27 +0200 Message-ID: <1477665207-9211-1-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 2.7.4 (Apple Git-66) MIME-Version: 1.0 X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL02.citrite.net (10.69.22.126) X-DLP: AMS1 Cc: Wei Liu , Boris Ostrovsky , Ian Jackson , Jan Beulich , Roger Pau Monne Subject: [Xen-devel] [PATCH for-4.8] tools/libacpi: fix sed usage X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Current usage of sed in the libacpi Makefile make uses of non-POSIX options, that are not available on all the OSes supported by the Xen tools. The '-i' option has slightly different semantics between GNU and BSD sed implementations, while on the GNU version the suffix is optional, on the BSD one it is not. Also BSD sed seems to have problems parsing the script itself, reporting "extra characters at the end of d command". Fix those issues by piping the output of awk into sed directly, and replacing the script with a simpler version that achieves the same purpose (removing the initial license header comment). Signed-off-by: Roger Pau Monné Reviewed-by: Boris Ostrovsky --- Cc: Boris Ostrovsky Cc: Jan Beulich Cc: Ian Jackson Cc: Wei Liu --- tools/libacpi/Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/libacpi/Makefile b/tools/libacpi/Makefile index 18a5cd4..c9eb514 100644 --- a/tools/libacpi/Makefile +++ b/tools/libacpi/Makefile @@ -47,9 +47,8 @@ $(MK_DSDT): mk_dsdt.c ifeq ($(GPL),y) $(ACPI_BUILD_DIR)/dsdt_anycpu_qemu_xen.asl: dsdt.asl dsdt_acpi_info.asl gpl/mk_dsdt_gpl.sh $(MK_DSDT) - awk 'NR > 1 {print s} {s=$$0}' $< > $@.$(TMP_SUFFIX) - # Strip license comment - sed -i '1,/\*\//{/\/\*/,/\*\//d}' $@.$(TMP_SUFFIX) + # Remove last bracket and strip license comment + awk 'NR > 1 {print s} {s=$$0}' $< | sed '1,/\*\//d' > $@.$(TMP_SUFFIX) $(SHELL) gpl/mk_dsdt_gpl.sh >> $@.$(TMP_SUFFIX) cat dsdt_acpi_info.asl >> $@.$(TMP_SUFFIX) $(MK_DSDT) --debug=$(debug) --dm-version qemu-xen >> $@.$(TMP_SUFFIX) @@ -57,8 +56,8 @@ $(ACPI_BUILD_DIR)/dsdt_anycpu_qemu_xen.asl: dsdt.asl dsdt_acpi_info.asl gpl/mk_d # NB. awk invocation is a portable alternative to 'head -n -1' $(ACPI_BUILD_DIR)/dsdt_%cpu.asl: dsdt.asl dsdt_acpi_info.asl gpl/mk_dsdt_gpl.sh $(MK_DSDT) - awk 'NR > 1 {print s} {s=$$0}' $< > $@.$(TMP_SUFFIX) - sed -i '1,/\*\//{/\/\*/,/\*\//d}' $@.$(TMP_SUFFIX) + # Remove last bracket and strip license comment + awk 'NR > 1 {print s} {s=$$0}' $< | sed '1,/\*\//d' > $@.$(TMP_SUFFIX) $(SHELL) gpl/mk_dsdt_gpl.sh >> $@.$(TMP_SUFFIX) cat dsdt_acpi_info.asl >> $@.$(TMP_SUFFIX) $(MK_DSDT) --debug=$(debug) --maxcpu $* >> $@.$(TMP_SUFFIX)