From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 30 Nov 2023 07:10:11 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1r8aFW-00E3Ao-24 for lore@lore.pengutronix.de; Thu, 30 Nov 2023 07:10:11 +0100 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1r8aFX-0002uQ-0a; Thu, 30 Nov 2023 07:10:11 +0100 Received: from mail-be0deu01on2040.outbound.protection.outlook.com ([40.107.127.40] helo=DEU01-BE0-obe.outbound.protection.outlook.com) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r8aF6-0002tt-Rv; Thu, 30 Nov 2023 07:09:45 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BbOld85wD3mJLBs9SO87pY6Rb6pUkFiIEXraSyZiOKNCNGtzmZRupCeb1Ahjc6znMdU1b4YP/n7xCfWPMdeY2agkNX2yGoHENVM2/o4YzsoDa2zqRLLk7yi4DRRnywerj9aI0QGYoAGKTFirkWxHwDcKwJ5HykW/YPuqq2MZ8ume9SBJOKiub3QHydbinCsgi6fYFaaTL2K/rgEtJEd6ENqqIqJxPMgt+uTUYSk8S5JFTnaP+S3vt8mdRSA2AI9MHN9qrOh0zCxUnHU/UrmtjmcrHFtfZwQBcwk85JDaNpFVQW7DV66vleDXhOcjhwnpGTYx2i4TcGDan/Ie0kKtjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=X/wOnKG+k3TXlm4R8J2g1+mRUkAE/ABdfmjOArLLpqY=; b=RmULv+w3sAc0oBTF1b4RThxYtYj/jmbRnl3Yw8KCF+8utN6iyLECJRpz/7Om2xB3zqk1Yb7utmtPN6K1Xea05Wx/8IURtLlycgRt5UA1d1lVC3nA3MvFpgJv3aZ41knYautmK+sXqfMLW+nNfvprJxpER4q6vubnqLCwPe5jx/M+DLCZeH8QakoyvpOHciSO2ca/YPgpfNCu4UW6zj+2afS3ja29NzjiVkFin7HWbblKB7OAO0yPXXU1xDIfCaCaoRi/pisOcYVoUQKvIW6Me/ytg4zXEDmb/XU5iIbY7Inve05iSPoXb5r2lPuTumP07vNeHovw721wc0+mCFDVHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=eckelmann.de; dmarc=pass action=none header.from=eckelmann.de; dkim=pass header.d=eckelmann.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eckelmann.de; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=X/wOnKG+k3TXlm4R8J2g1+mRUkAE/ABdfmjOArLLpqY=; b=dnGF85LtR+hqDrhT6RUvIDtW4jCBdP5DrwuR50UTeBm1DL1VXmYItjqUJxZJZQfx0bokdsNIuGm/dLwzHd7jXl+H7+PyjP0eMKmrotL5C3I0LtqYTmJ/gGN3T7z3du1bBs9Iy79YXCXluyPuaikmDDUYMMNqy7Sj2XCOpLoDHu8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=eckelmann.de; Received: from BE1P281MB2529.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:69::5) by BE1P281MB2982.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:4b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.28; Thu, 30 Nov 2023 06:09:42 +0000 Received: from BE1P281MB2529.DEUP281.PROD.OUTLOOK.COM ([fe80::7df2:d6d4:333:fde9]) by BE1P281MB2529.DEUP281.PROD.OUTLOOK.COM ([fe80::7df2:d6d4:333:fde9%3]) with mapi id 15.20.7046.024; Thu, 30 Nov 2023 06:09:42 +0000 Date: Thu, 30 Nov 2023 07:09:41 +0100 From: Thorsten Scherer To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= Message-ID: <20231130060941.fslan5ajijx5cp2w@nb821.eckelmann.group> References: <20231129093743.906378-1-u.kleine-koenig@pengutronix.de> <20231129093743.906378-2-u.kleine-koenig@pengutronix.de> Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20231129093743.906378-2-u.kleine-koenig@pengutronix.de> X-ClientProxiedBy: FR0P281CA0066.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:49::12) To BE1P281MB2529.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:69::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BE1P281MB2529:EE_|BE1P281MB2982:EE_ X-MS-Office365-Filtering-Correlation-Id: 2eb89dea-3fdc-45ee-3757-08dbf16af190 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O4RXDlMoE8RTzVh2PBqdQ1NTCGMyYDjPTDJf0ThL4vjonrAyqaFkZI+n2MBiDzYN5jZKxJ/Lg1hsKmDIayHD9Ilvsvj56wjtfcEIpC2Dq1pt2HVdY7KEQd18lw3i/n6SKhzF1qpVqRDcKQhZa3anpLUbaM5WTxpsNN6ISIuvP1YjgyrDkDpqldZ5sH3D0Zij9nw4CpDXYMMffPZ8SObl6dq43Uow7Di6tSgZw+jbt8DsMzLvk6BDS8LXj+E/hj8vDLjKT1VtkdkTk5HA8wsMA+hIa1m1CbJldomPjzeUUIGDcO9qq/kb5k3J5oX9MzoJpOJB7dVNU1lb1Expkuz7PAdLTnO5Pz+lGwj3Sn8TEWZhoZ1H9OzaNChTj7dKRqy/uc5EbPvwJeewz7Ke5pgrPzOfPIWyUEriG3axt85gUsTW48VMOufUJbFWronR2shj2Y+3eL7ctJchld7D7s1soOMubrTF7gVOfCoc0znS6ZFLajDiHqrjchOrGGSZrzKskJz7LM1uU12ZwAFnpNA64mGv3nNl18jCcUFqeraUVkzyKixJ3LvJLTN3u02t3SFNYKpCS+QUY9sMKP0G8uAvhxkThZrPUeje1yoC4f0rlLQAEKaf6KwxTeE6EPCrf4ZtNCF8ZxOVbYKq9DI8kNfSNK4wyEgOkm+tXt5YQP1C/n8= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BE1P281MB2529.DEUP281.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230031)(136003)(396003)(376002)(39850400004)(366004)(346002)(230922051799003)(186009)(451199024)(64100799003)(1800799012)(202311291699003)(1076003)(66574015)(9686003)(6512007)(83380400001)(4326008)(316002)(450100002)(8936002)(6916009)(66476007)(5660300002)(478600001)(66556008)(6486002)(86362001)(66946007)(6506007)(8676002)(38100700002)(41300700001)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?JG2Sz/xfcJ71XmcUm17bnwvtVfZszewvGtwVMMhT36E9ZhJkGYbPDjnd6U?= =?iso-8859-1?Q?eX052nFWvKbXEfteBiS7c8kXTEbhMzVzROP+xZH+SEmNTxB1QAZGpH9/hs?= =?iso-8859-1?Q?U2locrpVMylCOH7OaK4AzwSCI/LF54COqI2yJePhxup39OI7AYmfGmGF7U?= =?iso-8859-1?Q?wEG/Ib/ZHDgIOL3TIlQuZi3Kx6GH5vretBO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?hRJeFAzubMRH32dgVJp5H1AWwRUqpfCU7q477Dzyqhk0ExKYiin0fzb3oy?= =?iso-8859-1?Q?zD0XX/hlCYywJJkonffLGGkMNekmFEiDcXrJzsufR1eB4yTPQrbnvMIp9i?= =?iso-8859-1?Q?lCC0+KqmjRlIRSDV3e6hLzJdTgJ6hejUwj9Ml60FBS8cRn+yglHyQX/cgA?= =?iso-8859-1?Q?pFaJPgHRe+HAltkTPpcnC8SOr4vF2vc4f933gpxO0L5HscYSL1f6InvmZZ?= =?iso-8859-1?Q?/16Tsde0VuOUXoBkGYtCOKGL02se0NEeQMY3js5a7GCBc0jYlyqIdL7bXS?= =?iso-8859-1?Q?WKCD4eInWS2LOegV6QxZ2LQn9sfYmGuLs6ZDMYtj4uuVmb07wR8dNLJ1rc?= =?iso-8859-1?Q?NDanFupoCHBlzItNf2qMfy7pXXq2nnWDdvcvseWkMNXf8E5X9E7Qsnp/V0?= =?iso-8859-1?Q?yVDcMa1xuZGytPJsz7s1B1xDU2j9/Ra1YUTPkJVCGT/SY2iKpY/pe0J/c2?= =?iso-8859-1?Q?py3FxFTG0IP1xkG8XegaruFlU5xYIqjC2b6uWfbwR2i5/nHNutI98R+eY1?= =?iso-8859-1?Q?9Vl7WFSnwGHZmrGUCkb8An+REIjp5AQqmvVedr7VltsH7ie9fkm6HptgM8?= =?iso-8859-1?Q?8SLL0A4qeAWFVVqLB7PxWuq+xjMqauVTbFI+vJCoxzuAdeXg9n745XRtjf?= =?iso-8859-1?Q?Q+ow=3D=3D?= X-OriginatorOrg: eckelmann.de X-MS-Exchange-CrossTenant-Network-Message-Id: 2eb89dea-3fdc-45ee-3757-08dbf16af190 X-MS-Exchange-CrossTenant-AuthSource: BE1P281MB2529.DEUP281.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2023 06:09:42.6162 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 62e24f58-823c-4d73-8ff2-db0a5f20156c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UMR7AnA5MnZlDNXR4swoLSAcTKQKBAilGI3VB6HOuqibzDuCuXWph93fCQ5XYr6O7M/zABEkWSQbMuEBGgvzeA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BE1P281MB2982 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-102.8 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_WELCOMELIST,USER_IN_WHITELIST autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [ptxdist] [PATCH 1/3] git-ptx-patches: Fix a race condition X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false On Wed, Nov 29, 2023 at 10:37:45AM +0100, Uwe Kleine-K=F6nig wrote: > As the loop over the output of find moves files around, it can happen > that find lists files more than once. In that case not only the "From " > line is removed, but also the next one (usually the "From:" line). >=20 > To process each patch in series.auto exactly once, iterate over that > file to remove the "From " line instead. Still be a bit conservative and > make sure that only the intended line is dropped. >=20 > Reported-by: Thorsten Scherer Tested-by: Thorsten Scherer > Signed-off-by: Uwe Kleine-K=F6nig > --- > scripts/git-ptx-patches | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) >=20 > diff --git a/scripts/git-ptx-patches b/scripts/git-ptx-patches > index a063cb73a875..df004fb8a8a5 100755 > --- a/scripts/git-ptx-patches > +++ b/scripts/git-ptx-patches > @@ -221,6 +221,13 @@ cat .ptxdist/series | _md5sum >> .ptxdist/series > =20 > # The first line of the patch is 'From ...' > # remove it to avoid unnecessary changes in the patch files. > +while read patch para; do > + # There are no comments or empty lines in series.auto, so no need to > + # handle these. Also be a bit cautious to only remove lines matching > + # "^From ". > + sed -i '1{/^From /d}' ".ptxdist/patches/$patch" > +done < .ptxdist/series.auto > + > find .ptxdist/patches/ ! -type d | sed -e 's,^.ptxdist/patches/,,' | \ > while read patch para; do > case "$patch" in > @@ -228,9 +235,8 @@ while read patch para; do > *) ;; > esac > if grep -q "$patch" .ptxdist/series.auto; then > - p=3D".ptxdist/patches/$patch" > - tail -n+2 "$p" > ".$patch.ptx-patches" > - mv ".$patch.ptx-patches" "$p" > + # ok, this is one of the patches we just touched > + : > else > if grep -q "$patch" .ptxdist/series.{0,1}; then > echo "Base patch \"$patch\"!" > --=20 > 2.42.0 >=20