From patchwork Thu Dec 15 14:30:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaius Mulley X-Patchwork-Id: 33656 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp391517wrn; Thu, 15 Dec 2022 06:31:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf6l0V/lEyhYRTcv+QB0RV6QbafOrKL4IqoHkqLsuRjAX+GNLkaaKVx2EtT2wlPSD2ISwPZ5 X-Received: by 2002:a17:906:5ad2:b0:7c1:98e:ed20 with SMTP id x18-20020a1709065ad200b007c1098eed20mr22189064ejs.35.1671114700732; Thu, 15 Dec 2022 06:31:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671114700; cv=none; d=google.com; s=arc-20160816; b=AlQiy311UoDdCKw2rzayxx4DEaDCYPupCzg/0qlZPfbQuI9UqzO9lfTssK+KD5TC6f g6gSX4YVAghwd+R2mmz4HkRtRiPDNRUWYpHaoigIrxgt6U8v+sLM68jk3SRY5aAA7B6W WGa+rB2fI4isC9C5qkNqPy6h1W+V8kML2UsHNhOmnixauy2imERNm+mSHieOI4RGgFRc OgHxRgKVw/aciPvFoCEeuKNynveTHHjVb77drPG6YNOI2wqmtnb5aPT26yO71kWmjcGk SHnf2/7z6P6QmbH9VCygBL0Bbyu9OnJJlE+1qFRuqLirn61dbgczrD6kD0EuLUd5lI4D gYvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:message-id:date:subject:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=nqJLco4aiDETES3U4MYNq5oYIwWxg0BZ/NJ/bvmc+pA=; b=l2JTil8rdXnIIybqmlddLF0YL5Jzof0CzUBg40FyoqJ7n7V6NqtBGIlBzwExZqh95k GxqEeaLnV8XWl82WxP47/GSid92buv8tzzN1IpwGoek0isd0IhqwctiT0vwTEY+Z8eum EbDMk3zFdSxsHUgK+xIP2liXwPbGjJ8XCLXy8OpG1bIiedEjks9a3uQKnu8Xvef8Su3d 1USxrqnvBLHgC7ZmYkAd0k0u7vsBgv6Jbj3uBwgAkIdC5+jOcCvfgCoVqZ1mZf4dR6xt FJQwvFGXXBOiMeKqJyi+FuWIrjG3wN8D8Lv0ac1SeiY4gDzGyZafWUgDylIb3gW3JJhG wQnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=SM5R1Dcs; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id dt13-20020a170907728d00b007ac9a51342asi13773838ejc.188.2022.12.15.06.31.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 06:31:40 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=SM5R1Dcs; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 88FAA388F31E for ; Thu, 15 Dec 2022 14:31:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 88FAA388F31E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671114699; bh=nqJLco4aiDETES3U4MYNq5oYIwWxg0BZ/NJ/bvmc+pA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=SM5R1DcsL/AWYYjzJXsUFsRxibeer1nkAPV4pSDe1RhY+GYvZFk/JsX5VxPOttUQo kDyZr2b0H+Z0mADHw8HeKrH0NYgZAuql+yuJK4zQJ3jFbd2K/3c72rx+2b0njnYdOM apAMlgy4tp38VbnZhI2UfjHgEPDIwfbfcaIGJOUQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id AFD30388EF90 for ; Thu, 15 Dec 2022 14:30:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AFD30388EF90 Received: by mail-wm1-x331.google.com with SMTP id h8-20020a1c2108000000b003d1efd60b65so1883535wmh.0 for ; Thu, 15 Dec 2022 06:30:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nqJLco4aiDETES3U4MYNq5oYIwWxg0BZ/NJ/bvmc+pA=; b=m+Ayuwjn+ikqSlIY0txmg5jswlIa4mqfPjgK3KJiCnMRSxupARraug6nxvquexAjMo ao84O5ewRtyCV0LXPbe+2ru2xE5mXlZIv3moWnUaJGzJZOrxBwu14f453JzFyRdanlQd GvMqf9gQtM0wU5blwPU8Ku2dCLT7YRGVe0anGq/mygyCPYs23P1HVG8v9ycatVKzu9Qj OYOFq/cHXdp3ek6HTQ7J19FEtA8wr9kbD+lLSGpOoFR2v3VMESCgtgEjJdsr8//esWqe 0xHdZLkRb93rPeuZ8BVZq9eosA4Q/jhxSD+w7aiDcU6Q/A2CpCKxExP7vWgcwruhXoi0 WSxA== X-Gm-Message-State: ANoB5pmWxsN3RErpExWcVY5TC9uTVvF/AlTi6egng6/LRTKR7TFKdJ+k f8GdyUCNwIbaXA0XSy/HyooX2LukTB8= X-Received: by 2002:a05:600c:6543:b0:3d1:fcca:ce24 with SMTP id dn3-20020a05600c654300b003d1fccace24mr20968909wmb.32.1671114650098; Thu, 15 Dec 2022 06:30:50 -0800 (PST) Received: from lancelot ([195.147.220.46]) by smtp.gmail.com with ESMTPSA id j17-20020a05600c1c1100b003cf774c31a0sm7656083wms.16.2022.12.15.06.30.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 06:30:49 -0800 (PST) Received: from gaius by lancelot with local (Exim 4.94.2) (envelope-from ) id 1p5pG3-001F8l-IZ; Thu, 15 Dec 2022 14:30:47 +0000 To: gcc-patches@gcc.gnu.org Subject: [committed, pushed] PR-107607 m2: Remove bdepend on realpath, cut and echo Date: Thu, 15 Dec 2022 14:30:47 +0000 Message-ID: <87sfhgbuy0.fsf@debian> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Gaius Mulley via Gcc-patches From: Gaius Mulley Reply-To: Gaius Mulley Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752290768162662655?= X-GMAIL-MSGID: =?utf-8?q?1752290768162662655?= It can be replaced by a subshell'd cd just fine. (cd gcc/m2; autoconf-2.69) gcc/m2/ChangeLog: * configure.ac: Stop probing for realpath. * tools-src/calcpath: Break dependency on realpath, cut and echo. * configure: Rebuilt --- gcc/m2/configure.ac | 5 ----- gcc/m2/tools-src/calcpath | 34 ++++++++++++++++++---------------- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/gcc/m2/configure.ac b/gcc/m2/configure.ac index 756e01c4321..5583af7f64c 100644 --- a/gcc/m2/configure.ac +++ b/gcc/m2/configure.ac @@ -24,11 +24,6 @@ AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET -AC_CHECK_PROGS(regex_realpath, realpath) -if test x$regex_realpath = "x" ; then - AC_MSG_ERROR([realpath is required to build GNU Modula-2 (hint install coreutils).]) -fi - AC_CHECK_FUNCS([stpcpy]) AC_CHECK_HEADERS(sys/types.h) diff --git a/gcc/m2/tools-src/calcpath b/gcc/m2/tools-src/calcpath index e0817704f64..05324513aa1 100755 --- a/gcc/m2/tools-src/calcpath +++ b/gcc/m2/tools-src/calcpath @@ -23,27 +23,29 @@ Usage () { - echo "Usage: calcpath pathcomponent1 pathcomponent2 subdir" - echo -n " if pathcomponent1 is relative then pathcomponent1/pathcomponet2/subdir is" - echo " returned" - echo " otherwise pathcomponet2/subdir is returned" - echo " the path is checked for legality in subdir." + cat<&2 + exit 1 +} if [ $# -eq 3 ]; then - if [ "$(echo $2 | cut -b 1)" = "." ] ; then - # relative path - the_path=$1/$2/$3 + case "$2" in + /*) the_path="$2/$3" ;; + *) the_path="$1/$2/$3" ;; + esac + cd "$3" || die "could not access $3" + if ( cd "$the_path" ); then + printf '%s\n' "${the_path}" else - the_path=$2/$3 - fi - cd $3 - if realpath ${the_path} > /dev/null ; then - echo ${the_path} - else - echo "calcpath: error ${the_path} is not a valid path in subdirectory $3" 1>&2 - exit 1 + die "${the_path} is not a valid path in subdirectory $3" fi else Usage