From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 8316F3861863 for ; Thu, 15 Feb 2024 12:24:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8316F3861863 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8316F3861863 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707999852; cv=none; b=wTFyOP4YqfZ0Ijs70drENHYcOlaSzF5T7WV7gAAdIjCBui1H1gwyRZGAIZ7yRk2f51A5HkIEtOnMxI2oVhC6zoImezVXTSR/iF4jGuFB00+JbcaTmzhAqiLPAVZ2mDToncPFuaTMygV+2latBCOQNexTS7x7hO1OVzeMf1x3Hwc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707999852; c=relaxed/simple; bh=f1SoHVFH+fO71xUsHsuIehXEHKaVE6JFk4lK0l+4rxA=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=ukqvlE0b+OXCzY+n7MsOzhBpHWsxFtlRM8GJGxoC6acvt5LduxWXSp2M//MjAnCUaWdL/dwq16EcqwnBxQaPS1joOqIM5SO30/k479woDhtPpbn5Oh0qPW0cqJUZSXfkZNJLA4M+II4Foe/N2vLCxgaPzgGaKpbX5T/n/GKTRrA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707999850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NExoFRwg9PYLj5cH4HyMMRx6EKJWzz4Wgkxfi4plZ3Y=; b=CmXSDKtNx38Qt1KrnX6SH+VASZ8gZbxikRAOyFgwo5Kscu04u1hKqk94lays4al/u15GI1 RDNUHilwBwzi9XtiGEML48vYYtRck5IN7sJyjVupUsDdTmOStITHXYm3fxAHmmErWnjoRV Gu7Vclsu40myf13EKsaOkE42jDngmc8= Received: from mail-ua1-f70.google.com (mail-ua1-f70.google.com [209.85.222.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-119-yyK0zGeJOx6SKCHb_gYPTA-1; Thu, 15 Feb 2024 07:24:09 -0500 X-MC-Unique: yyK0zGeJOx6SKCHb_gYPTA-1 Received: by mail-ua1-f70.google.com with SMTP id a1e0cc1a2514c-7d2d72f7965so487969241.2 for ; Thu, 15 Feb 2024 04:24:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707999848; x=1708604648; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NExoFRwg9PYLj5cH4HyMMRx6EKJWzz4Wgkxfi4plZ3Y=; b=X3rNWfL/gmV3vTb3d/YlHK59+jwq9w7gfOJPTyOOAdyqHwfZBi8Ljf0epAcSMMTrx1 D/vmKzpwCbMS6gdZ6aeD4vgAgRan3v9CC6fnIYrT9Ne3EkTWzmGxhAebwh/DWrB8rWS1 gaG4scqwFAKLv9c9EeqgMF8nx5ypJFUjCKw3FPz29f2zxvhuvZinmgK1xDsTjCiKU/aY k0QSEFjs1E6E9dW1tcFB6PA7jDVHhQ2t+l9lykZtX2qYZQhPaiSlpot8govkrxC7dI0l xTlUg1TfxBsmLd6plF3vPrIfMxP68ghTyuHQx0W5BXzeshSPfPdWGR4leBawGNjZ6Nlq vgLg== X-Gm-Message-State: AOJu0Yy6nSGLc80+vKntq9BQn1aglE2RA971L01gXwWLaEZ5eyjclA+w mfm4kKkSqDCWyMFenwMKs4lgoEmWBlC7y7HQZXkKXkjZMoop/oJRZrp+Xuv2eRTCaYW1q4MKwBy NIntdC2scQkkIvlmDZOC2bIHOdWt00TXaHgTMZwUzbze/eMCejCBr7iV6eg== X-Received: by 2002:a05:6102:c50:b0:46d:404a:21c6 with SMTP id y16-20020a0561020c5000b0046d404a21c6mr1537362vss.13.1707999848537; Thu, 15 Feb 2024 04:24:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IHm6ZwdBZcQUR7yplW7wQu6E24wPZ5T4U1LcjFpG0vUCY1WlgkiTmCRYZSVDCPUmIcQ7E1BtA== X-Received: by 2002:a05:6102:c50:b0:46d:404a:21c6 with SMTP id y16-20020a0561020c5000b0046d404a21c6mr1537347vss.13.1707999848233; Thu, 15 Feb 2024 04:24:08 -0800 (PST) Received: from [192.168.0.241] ([198.48.244.52]) by smtp.gmail.com with ESMTPSA id n12-20020ac85a0c000000b0042dafe6a833sm519071qta.54.2024.02.15.04.24.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Feb 2024 04:24:07 -0800 (PST) Message-ID: <15d11dbf-1677-4c48-a425-7067dbae1c4c@redhat.com> Date: Thu, 15 Feb 2024 07:24:06 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] sort-makefile-lines.py: Allow '_' in name and "^# name" To: "H.J. Lu" , Florian Weimer Cc: libc-alpha@sourceware.org References: <20240215112719.392617-1-hjl.tools@gmail.com> <87edddc48s.fsf@oldenburg.str.redhat.com> From: Carlos O'Donell Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 2/15/24 07:19, H.J. Lu wrote: > On Thu, Feb 15, 2024 at 4:16 AM 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-lines.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 = \", "var := \" or "var += \" >>> # to start the sorted list. >>> - var = re.search(r'^([a-zA-Z0-9-]*) [\+:]?\= \\$', lines[i]) >>> + var = re.search(r'^([a-zA-Z0-9-_]*) [\+:]?\= \\$', 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.py > 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 = \", "var := \" or "var += \" > # to start the sorted list. > - var = re.search(r'^([a-zA-Z0-9-]*) [\+:]?\= \\$', lines[i]) > + var = re.search(r'^([-_a-zA-Z0-9]*) [\+:]?\= \\$', lines[i]) Yes, exactly, I agree with Florian here you want to show that the literal '-' and '_' are not part of a range in the character class. So either start or end is fine with me. Looking forward to v2. Thanks for fixing this! > if var: > # Remember the index and the name. > startmarks.append((i, var.group(1))) > >> Thanks, >> Florian >> > > -- Cheers, Carlos.