From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 6BE161F4D7 for ; Thu, 21 Apr 2022 21:30:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442155AbiDUVc4 convert rfc822-to-8bit (ORCPT ); Thu, 21 Apr 2022 17:32:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442120AbiDUVcp (ORCPT ); Thu, 21 Apr 2022 17:32:45 -0400 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3603CE35 for ; Thu, 21 Apr 2022 14:29:54 -0700 (PDT) Received: by mail-pl1-f175.google.com with SMTP id u15so3164526ple.4 for ; Thu, 21 Apr 2022 14:29:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=RPo9skY38g0RkO0dx494xnTOLxDwwv/5ScgRtpPRXgE=; b=FxpuxJiA0CZi7oXwnU2xFyKfPTMZLmIoToKjNYmmIM2TJHCzZ44rM7+2gdOL1IjAN6 10zYMaZDVC4jXMkSd2ViMZN12/NUBqZLzgjxmfN1VatWO7b4ylpH2Tl515NXuXXBsLN7 3OMK64oe9geoLL//6rX7MVNhShSoSdiiiy1FU8OU3DMFS4zwxGes6jessg8r9NMLo+hW diwHFXUbPLes6iTr0+LvItxu0NhclLfaoNR0kKy5+vVtH3JsE3LIBp2bC/AkIGhWjcIy WU6smH4f9WEsNRKz4QQv3Va2SGJSK4trbROlPLdF+6Rv6iTBBCARyaj/kHJvYPvMmfxP YrTw== X-Gm-Message-State: AOAM531V5zb5jBLDWIMoJmjSrFIjZsu7VcokaIPih+n1lXAcBMHWf/+S o53onvwoLUTQocYEGCAodIG/PJ9FrhNZv8zx2Uo= X-Google-Smtp-Source: ABdhPJz6qVOjqXYbA8iZjvfeR8nQTYjk1fL68gZnBHmIDy9hsJVRDxSK5pp6avuB8UMBMM7h5kdb7oLoYTzrSfGmtFc= X-Received: by 2002:a17:903:2302:b0:158:cef1:79b9 with SMTP id d2-20020a170903230200b00158cef179b9mr1215867plh.64.1650576593648; Thu, 21 Apr 2022 14:29:53 -0700 (PDT) MIME-Version: 1.0 References: <220421.86pmla5eja.gmgdl@evledraar.gmail.com> In-Reply-To: <220421.86pmla5eja.gmgdl@evledraar.gmail.com> From: Eric Sunshine Date: Thu, 21 Apr 2022 17:29:42 -0400 Message-ID: Subject: Re: [PATCH 2/2] CI: don't care about SHA256 mismatch on upstream "perforce" package To: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Cc: Junio C Hamano , Git List , Derrick Stolee , =?UTF-8?Q?SZEDER_G=C3=A1bor?= , Taylor Blau , Johannes Schindelin Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Thu, Apr 21, 2022 at 5:10 PM Ævar Arnfjörð Bjarmason wrote: > On Thu, Apr 21 2022, Junio C Hamano wrote: > > Ævar Arnfjörð Bjarmason writes: > >> + sed -i -e 's/\(sha256.\).*/\1:no_check/' "$path" && > > > > "sed -i" is not POSIX and without macOS box I do not know if it > > works there. FreeBSD sed manual seems to indicate they have > > > > sed -i > > > > Ah, no, I'd say we should NOT use "sed -i" here, not in the form in > > this patch, after seeing > > https://unix.stackexchange.com/questions/401905/bsd-sed-vs-gnu-sed-and-i > > but that is 4-year old information, so... > > It works on the OSX we use now: > https://github.com/avar/git/runs/6092916612?check_suite_focus=true On my end-of-life'd 10.13 macOS, `sed` (which is the FreeBSD version) requires an argument after `-i`, thus it's taking `-e` as the extension name for the backup file, and then uses the raw 's/\(sha256.\).*/\1:no_check/' as the `sed` command. So, it's working, but only by accident since `-e` is optional when invoking `sed`. > I think it's fine to keep it, but we could also use "perl -pi -e" here, > or a rename dance... Although it's working (by accident), it's rather misleading since it looks like `-e` is introducing the `sed` command, even though it really isn't (the `-e` is being consumed by the `-i` option). Any of the following would likely be less confusing (in no particular order of preference): * sed -i .bak -e '...' "$path" * rename dance * perl -pi -e ...