From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) by sourceware.org (Postfix) with ESMTPS id 478FD3861863 for ; Thu, 15 Feb 2024 12:19:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 478FD3861863 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 478FD3861863 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707999582; cv=none; b=qT4OzDdp1625FRGMLwcBSrJOStcfNe+bqty6QSzJAWhvVWaLW+3H8rCFQLoFM4ox5MCDsKYV9fY5zdrwZ4C1btmdpgtqkRTOvtlD1/QYQRskL/gEOyiLM5VpWaGqLx7EWUntDgvCCQ1zPkbrxLOnKqcYdZR4nEXsOu+zYJd6BT0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707999582; c=relaxed/simple; bh=ZtpgvHdGalgD0c78MMxOWWLAFuRtTLnSe607DLHuqA8=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=NV8eYV/KZwvOUnz0IEkKgFhxDPFF5tSTNr/PrYi3J1eIQB55OmDWtbHqE5V0XOj6w6hB47vw0yiTSRvqkyCPOonUracydMHnDZAuo31rSazSPmXq3F2Vd3mR+kB/5QmTBDeQrPezodYFml8eHkZJVjuOvQq/f+gkvz+oEzUfbcE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-60790e62f90so8187427b3.1 for ; Thu, 15 Feb 2024 04:19:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707999580; x=1708604380; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=w/cWLAmLkjmW4HnEZzBB8c5Cjr19i49T14ubQ8IYW3Y=; b=GpP6m6vL5ImuO025GakCecDAy104BmKJTpjSCN/X2ABYSUi1Gi2iUfLIkKK+N83M5w eBb/mDczMTS/2spI25WfFvmdwyZvKL9BeXKUp000B2T8uc2TL3cHOQbTm/w5lbMqLOIj e0yd9Zn+8cXheiPHZtSIoX+diLLysiEQDl7mAPYeveKeZestpf+Nn54emuxl/NAFkCoj Ddzwc3wJkStbNfTGR1QPxbZdMJ+AZekLhP32GXkCaPCxjh1EWXLIyHvjqUEVGHmpudxy vHjuiugnS5gXv3asws4oBULjt2aXQvX4SjO+nmSshszZVHVOvZCXrtbAMyI3EAaWPkl4 N/Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707999580; x=1708604380; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w/cWLAmLkjmW4HnEZzBB8c5Cjr19i49T14ubQ8IYW3Y=; b=VcPTZn12eiVfT2ny3ZxI/YexTy/CZ3BZlPLApWgOdskbNpajU6deCY69JTCGC8+L3e 8NPbiydV8u+TlLB38eVEj/aKBklucL9BWDIdevsmwUEYBffXGCmMowVAPgjSDLlavi34 CcOKia2KMau5/dnVlmx/+XI0BUDSGs629QJNAFa5UxwxCyQ5iorMLcfAPwFD4VloWtiF ZV/si/juPWS3uq19GPK+NBafrl2rkUhf64Ti1h31f++Gx/HuOzbbDHFDbi/o/S327L3O eMJICopDYvUoQKvsHCum2kwd3WgIvQ3UN/gNrzCVBgJQKI4ggIYlaIiwbvzffuL3Tl5x gwZw== X-Gm-Message-State: AOJu0Yz1jtUErskguAaHUnYP5YmCWv4JNejVEhVjDCnHUYgWWHyD3D0L qW5jdKl0rlv2jfiPx1DeZglDp66Wri1GD9vHG/WxVuUdJk28rdPjaTjBjz9ZOzGOJ79Kx9L1/JX Z0RzZ9UdLGaXIjp7NaKv/bwls3H4Pt85Z2/w= X-Google-Smtp-Source: AGHT+IExBga0hfbioMkikSV4SZ5+GAO9klgQsQWl7OBYEgCLqWvFgN1TVJH3XMLADTcfXY9nCcKAkXrm3x6KJ6xTm7U= X-Received: by 2002:a81:a0d1:0:b0:604:af12:124e with SMTP id x200-20020a81a0d1000000b00604af12124emr1436565ywg.42.1707999580636; Thu, 15 Feb 2024 04:19:40 -0800 (PST) MIME-Version: 1.0 References: <20240215112719.392617-1-hjl.tools@gmail.com> <87edddc48s.fsf@oldenburg.str.redhat.com> In-Reply-To: <87edddc48s.fsf@oldenburg.str.redhat.com> From: "H.J. Lu" Date: Thu, 15 Feb 2024 04:19:04 -0800 Message-ID: Subject: Re: [PATCH] sort-makefile-lines.py: Allow '_' in name and "^# name" To: Florian Weimer Cc: libc-alpha@sourceware.org, carlos@redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3020.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Feb 15, 2024 at 4:16=E2=80=AFAM Florian Weimer = wrote: > > * H. J. Lu: > > > '_' is used in Makefile variable names and many variables end with > > "^# name". Relax sort-makefile-lines.py to allow '_' in name and > > "^# name" as variable end. This fixes BZ #31385. > > --- > > scripts/sort-makefile-lines.py | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/scripts/sort-makefile-lines.py b/scripts/sort-makefile-lin= es.py > > index f65ee40e27..ea02412d67 100755 > > --- a/scripts/sort-makefile-lines.py > > +++ b/scripts/sort-makefile-lines.py > > @@ -129,7 +129,7 @@ def sort_makefile_lines(): > > for i in range(len(lines)): > > # Look for things like "var =3D \", "var :=3D \" or "var +=3D = \" > > # to start the sorted list. > > - var =3D re.search(r'^([a-zA-Z0-9-]*) [\+:]?\=3D \\$', lines[i]= ) > > + var =3D re.search(r'^([a-zA-Z0-9-_]*) [\+:]?\=3D \\$', lines[i= ]) > > if var: > > # Remember the index and the name. > > startmarks.append((i, var.group(1))) > > Please keep the literal - at the end of the bracket expression. I think > it's easier to read even if it may be semantically the same. Did you mean like this? diff --git a/scripts/sort-makefile-lines.py b/scripts/sort-makefile-lines.p= y index f65ee40e27..d791789671 100755 --- a/scripts/sort-makefile-lines.py +++ b/scripts/sort-makefile-lines.py @@ -129,7 +129,7 @@ def sort_makefile_lines(): for i in range(len(lines)): # Look for things like "var =3D \", "var :=3D \" or "var +=3D \" # to start the sorted list. - var =3D re.search(r'^([a-zA-Z0-9-]*) [\+:]?\=3D \\$', lines[i]) + var =3D re.search(r'^([-_a-zA-Z0-9]*) [\+:]?\=3D \\$', lines[i]) if var: # Remember the index and the name. startmarks.append((i, var.group(1))) > Thanks, > Florian > --=20 H.J.