From patchwork Thu Feb 15 12:29:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1899302 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=jZrEA9/n; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TbDs31GM3z23hm for ; Thu, 15 Feb 2024 23:29:27 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 194B9384F4A0 for ; Thu, 15 Feb 2024 12:29:25 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id AEA543861863 for ; Thu, 15 Feb 2024 12:29:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AEA543861863 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 AEA543861863 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::632 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708000148; cv=none; b=DADyuQ3JPm/mSWILcirQY6WskEMqeFcHZ6R8xtzfkWrh6UmjEHaHhS1xcZ17Rt02ZeXM5d4j0B6grIQZ41FkVHogxhYa8iPX5RLo5g/BS3FzmVsT2Yeuy5QNNypH3c/4ZaSXS/mYxlXAP51G5acuhjtWXAYSASx9nwyx5OB662M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708000148; c=relaxed/simple; bh=AycDYunYf5P8AHlf+46zx5tzqx8qnUaiO8z9B+KXNYE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=UttdsH9sycnQ71et1+NgDW77VLHGr00CSGc+sCjfFro+aaIAvq0f0jLAceeV5yGf3urVXUmttmB2aN4W/or4EBNj28NkTRBNSNzAFGesFfhPTx3x3uriwG5ODjsffJhcflnrCasEpaZhDB0QuM/cEitYl56c0c0JQS9jVpVmIUw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1d780a392fdso6785735ad.3 for ; Thu, 15 Feb 2024 04:29:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708000145; x=1708604945; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=vajfdJfEUjzppiCrCogp49Pxayh4EmNrJ6w/dyinuMs=; b=jZrEA9/nIJ/aW1SMjnGl9JI9NlW6+Pb4JEw01GiUR96ehjN7eWqadq1CpS2/zJ0n0q +J75gLRZmg+7iIKWzcCrxBenADYiX+70eF9J4ONfaLnHoJdSvw151SS0PmjI0fbkMrC8 OUUnCFBTTluSZROkIAy1OFcmeqwln2cEZgj3QQ7kwVfnkxk61QozXyw9fcObxA0pMIqp 6o0yp7JycceQrHW/5yVuhusxKxokVgLfomN+H/BRCjfgSbVvZi0EKHmy9wCrKZWNCmGk 8zr6gWR5yVGfmGJt5HcxkeYyey6CkwPrOolnS8/M88wI1Rjhcer6WurmSs2Cvt9/gfz9 rEGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708000145; x=1708604945; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vajfdJfEUjzppiCrCogp49Pxayh4EmNrJ6w/dyinuMs=; b=qB3uDMUKSl5XI1T6VyIV+u9AEtsLbQygXrluy2FLPUtrCuXIj7aiUk/+vsIeMiuwvU FsfGhTmD7kk0d/X7h6fl45eWza8YqouCbxnK2NIHjJdR/Rjb3EDpYpObIWa/qgvgpD5Z OpW31QAEwGWHhOb5HCsrMZnKEnv/ZnnH+LLblYdRr+RCq4cAzJMCcjwIfsb3I7NDlB+E ph/uDbPnNgCZgyCJPetODdFANcaFrF8g2noBviLa5jT0tUNq66E6ihwwq9f3gnIa/4ns djUv6+TziW5uHAGE43Z9/QaBZT2XS20PWHDJytaT5YxtXQTdCk/K2T55ulzyKakzobHk nOHA== X-Gm-Message-State: AOJu0YzYYLMpOwXw79AypkJxC4NK3/ubEKMpkRZgERv6eEaAWAlKyqHp yCgsq2s0gk/SiCRAIh7LBdSOj/mP/ipQupteRXtIeppMBNmYA2D5ppkVdxRN X-Google-Smtp-Source: AGHT+IHTc0VDUkq/X/iobEOF5chXAr9MxnyqUHTPbwPhXpG6CK8fZ6l/9tObacLOjRHQnpp7j553wg== X-Received: by 2002:a17:902:e810:b0:1db:4c96:b578 with SMTP id u16-20020a170902e81000b001db4c96b578mr1892351plg.59.1708000144571; Thu, 15 Feb 2024 04:29:04 -0800 (PST) Received: from gnu-cfl-3.localdomain ([172.58.89.72]) by smtp.gmail.com with ESMTPSA id r11-20020a170903014b00b001d9b749d281sm1167112plc.53.2024.02.15.04.29.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 04:29:04 -0800 (PST) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id 3B2D8740120; Thu, 15 Feb 2024 04:29:03 -0800 (PST) From: "H.J. Lu" To: libc-alpha@sourceware.org Cc: carlos@redhat.com Subject: [PATCH v2] sort-makefile-lines.py: Allow '_' in name and "^# name" Date: Thu, 15 Feb 2024 04:29:03 -0800 Message-ID: <20240215122903.394220-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-3019.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_ABUSEAT, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, 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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org '_' 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 = \", "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))) @@ -140,7 +140,7 @@ def sort_makefile_lines(): rangemarks = [] for sm in startmarks: # Look for things like " # var" to end the sorted list. - reg = r'^ # ' + sm[1] + r'$' + reg = 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).