From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by sourceware.org (Postfix) with ESMTPS id C897C384CB97 for ; Thu, 15 Feb 2024 17:28:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C897C384CB97 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 C897C384CB97 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708018132; cv=none; b=Sli/ficJ7s7SfXl/eGEH6lh9ZzzauwUDs/JK9jqxOjlHJ+AdRn7NhoKhJouCq+ACw5kerSDq3+ov07pOe4Mi5MkaBHOnE3WtDD5sjsW8qkGipmkO+c5ZWfALzi1kMNAuwL+7XwZbvgz4u3N9aS21Re4eMWjm1E+q5+Uq+R1BKII= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708018132; c=relaxed/simple; bh=11X6JJKhEAJHdwhcQtMUD7RYvr6IfydT13qIBQvDiOY=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=pQUUQqkfaB6Swg22lnPPwsiUkqonZ+Yel6oD72vonDAwdMkqDrdnZx6JgC0YACguCCQGwS0sbJljBIBwlieqbQgpm7W/K1sDy8BN1s5vFcayLgJUfMqZQC0ZHerV+1IN9bQr7Rmb38uGFM+z53DieU9D4uczfPOYLlgyAFMOcy4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-51147d0abd1so1283829e87.1 for ; Thu, 15 Feb 2024 09:28:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708018129; x=1708622929; darn=sourceware.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yohsDzxfp9axskkycv2CqIylboMw5gJiJGL4R1N9Too=; b=cSj94Y452WisAAtblkS4gwyR7Vosw9ATC/k3aBldjCiLS7MA2Gt1/V/I+HazLaOxRV XWtpsJW3mkMYWcxrCT33Q7+iAtKAzi5li2vqph3X4/d6o85FuvIYQ8aTXTbgqGEae6nV E6rtMg8Rw8Lfqc8ethMCtUsQG/pCNCLe4SqZrOdyixksQLvrAZJrzHhKUv1o1/RZ4/8F BfGeD9icj7UwWXckGsTG4aKFSkRuvwX5JCRfqeKUBZ2KaGfLnE2u52vFQiFQZTo+4y0X QRQ0UdATxCBElyG47DpjCYVewP8Xkmu6LXl6lnrcW+Sb0TucODbbV4xmfYysOecM6Pzw nV+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708018129; x=1708622929; h=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=yohsDzxfp9axskkycv2CqIylboMw5gJiJGL4R1N9Too=; b=W00yUv+yxJTJHx/HWq/a6EEgkymPUfH2ZhQR/8X4LXqfCowrFNsqgXLroFkGD3cfhn pLiETnKTCyV3BjZBDO5mqibyca0rUsF4LQaVNpvyzMZrAa9cQQ4P2d1KFmZpTZ+aGMS7 x3dJpWfXvYywhntNoJp5RJ1Ag7Jb9bOiOdrcdcKfj96GuS+gic8RDead6+IbVTaaQYZP UGHTuSnzIj7+vI5gtw59oxOrpUV6ZsnnrZk3EOMSvdc9eaRb3et2Zazy3svCXOd9RH+a 9TClAt2A+kyYIe1nBHgMtyJEoKocy15x8vWh6LrFXcHSpen/Vtv+8y95zPcwCuH/UN+4 jB6Q== X-Gm-Message-State: AOJu0YwrHLxvoQYT0AU01lvBtG9iRxKaFFOsmfl9HreKqR8yI/UvplEb jR7vx2ivJZ7iUpbvBBTv7nL4m5HNqIXi+mhWvRBZDyfwaX8JvojU3CYDPl023/KOUXbg2Rf5lnA v4rAekw/SAYnRd1QURca2lnRDgn33P49Y X-Google-Smtp-Source: AGHT+IHvti7A/ZVtbW0O8dW2GzeEsad1fzj7biRJ+ngcCvIYU6RDjGuz4awn9BDZ1ddttt40rIxlqR8SQ9unbsIc+qY= X-Received: by 2002:a19:c50f:0:b0:511:5e45:1150 with SMTP id w15-20020a19c50f000000b005115e451150mr1708226lfe.61.1708018129041; Thu, 15 Feb 2024 09:28:49 -0800 (PST) MIME-Version: 1.0 References: <20240215122903.394220-1-hjl.tools@gmail.com> In-Reply-To: <20240215122903.394220-1-hjl.tools@gmail.com> From: Sunil Pandey Date: Thu, 15 Feb 2024 09:28:12 -0800 Message-ID: Subject: Re: [PATCH v2] sort-makefile-lines.py: Allow '_' in name and "^# name" To: "H.J. Lu" Cc: libc-alpha@sourceware.org, carlos@redhat.com Content-Type: multipart/alternative; boundary="000000000000d9ffff06116ef5c8" X-Spam-Status: No, score=-6.6 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,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,HTML_MESSAGE,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: --000000000000d9ffff06116ef5c8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Feb 15, 2024 at 4:29=E2=80=AFAM H.J. Lu wrote: > '_' 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 | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/scripts/sort-makefile-lines.py > b/scripts/sort-makefile-lines.py > index f65ee40e27..b2249aef6d 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))) > @@ -140,7 +140,7 @@ def sort_makefile_lines(): > rangemarks =3D [] > for sm in startmarks: > # Look for things like " # var" to end the sorted list. > - reg =3D r'^ # ' + sm[1] + r'$' > + reg =3D r'^ *# ' + sm[1] + r'$' > for j in range(sm[0] + 1, len(lines)): > if re.search(reg, lines[j]): > # Remember the block to sort (inclusive). > -- > 2.43.0 > LGTM --Sunil --000000000000d9ffff06116ef5c8--