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 E91173858CDB for ; Thu, 18 May 2023 16:53:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E91173858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684428822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uwLlT/JfkM7gZA6cq5jI3KqwCNTR2sHp5HZtOwPV9EQ=; b=HEOcEuHQ7EO8BZPon18acVPhu4mzn6vZdfZWWqlSW3blX6Kojz65ALGmNXLslgslqTcO5H HctYSOSh8n52xjxwmihtdnp7QJsjdGQ7xXneudGTgc5i1t57J5FiJZ9OyrNqbLp8ij7tMc phyGwOB3+Edda9h+CeBhVDJUufXV9fo= Received: from mail-yw1-f198.google.com (mail-yw1-f198.google.com [209.85.128.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-21-alqp-mXDPlO4c531kgCn_A-1; Thu, 18 May 2023 12:53:41 -0400 X-MC-Unique: alqp-mXDPlO4c531kgCn_A-1 Received: by mail-yw1-f198.google.com with SMTP id 00721157ae682-5618b2341d9so35658707b3.2 for ; Thu, 18 May 2023 09:53:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684428821; x=1687020821; h=content-transfer-encoding:in-reply-to:organization:from:references :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=uwLlT/JfkM7gZA6cq5jI3KqwCNTR2sHp5HZtOwPV9EQ=; b=MBoTAvYJsuHbRmr3c9+msdOQLe4/P8F00Ns4JWSTGbkauD9LrfafIfdxNOOV7MNAnO CadD+H1EhcBUjytJJpXYsy7dM9WKrzeAqTeAKrrfgeXlPpNi1D7ET7i94a6oXpW1Yg8o e6TNP3LjitVsOiTnMXkEg91uIwZx4+YKrVpWBK+PQIbVD5i0MiVtkQOeQpnlnXNbFf2U pIdTfdJKbj0tGCGukBl3gqanTaeyzctRVsNXwvBiInuRZlOAZQi7wlq+5qiwbDLLs4cu qSvAgotqnKMZYJaem14BcS7JTnjb6NlhQjGuvSS0W4qBEFaMHQiT+lo6ZI6WZS3sXgXe nC8A== X-Gm-Message-State: AC+VfDw2palmaii1bi/GZiFyvIdpb8XYNNvJ1AV9zgCRrhHBz9ckmmMr P3k62Os9S23LGHkrzsmjkJS+mOMhU91fNraJ+aaliGFRg1NTExZJ2x8j++Sm0qYUwnOFQGUIfXh tcja+ANzqzw2fAITparxi X-Received: by 2002:a0d:d911:0:b0:55a:98ff:f07e with SMTP id b17-20020a0dd911000000b0055a98fff07emr1747296ywe.16.1684428820902; Thu, 18 May 2023 09:53:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ68N+eLAmBUTM9pYhZpB8c+XdQtwU6ql/8R6IbfXtaby8sA6SeeGbfB0DiEQOCZH5eh/IbyJg== X-Received: by 2002:a0d:d911:0:b0:55a:98ff:f07e with SMTP id b17-20020a0dd911000000b0055a98fff07emr1747111ywe.16.1684428815798; Thu, 18 May 2023 09:53:35 -0700 (PDT) Received: from [192.168.0.241] ([198.48.244.52]) by smtp.gmail.com with ESMTPSA id x63-20020a817c42000000b0055dbeb68f7asm528572ywc.69.2023.05.18.09.53.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 May 2023 09:53:35 -0700 (PDT) Message-ID: <8686b2d5-d92a-b32e-e43a-a7fd6172ce84@redhat.com> Date: Thu, 18 May 2023 12:53:34 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH 1/5] scripts: sort-makefile-lines.py To: Siddhesh Poyarekar , libc-alpha@sourceware.org References: <20230518130325.59309-1-carlos@redhat.com> <20230518130325.59309-2-carlos@redhat.com> <480a6711-131c-61d2-8497-bbe115dbf0c0@gotplt.org> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <480a6711-131c-61d2-8497-bbe115dbf0c0@gotplt.org> 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.5 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,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 5/18/23 11:56, Siddhesh Poyarekar wrote: > > > On 2023-05-18 09:03, Carlos O'Donell wrote: >> We must return < 0, 0, or > 0 as the result of the comparison function >> for cmp_to_key() to work correctly across all comparisons. >> --- > > LGTM. > > Reviewed-by: Siddhesh Poyarekar Thanks for the series review! I've pushed this along with a rewrite of nptl/Makefile as consensus. >>   scripts/sort-makefile-lines.py | 5 ++++- >>   1 file changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/scripts/sort-makefile-lines.py b/scripts/sort-makefile-lines.py >> index fd657df970..c0badebf8c 100755 >> --- a/scripts/sort-makefile-lines.py >> +++ b/scripts/sort-makefile-lines.py >> @@ -102,7 +102,10 @@ def glibc_makefile_numeric(string1, string2): >>               # string1 and string2 both share a prefix and >>               # have a numeric suffix that can be compared. >>               # Sort order is based on the numeric suffix. >> -            return int(var1.group(1)) > int(var2.group(1)) >> +            # If the suffix is the same return 0, otherwise >> +            # > 0 for greater-than, and < 0 for less-than. >> +            # This is equivalent to the numerical difference. >> +            return int(var1.group(1)) - int(var2.group(1)) >>       # Default to strcoll. >>       return locale.strcoll(string1, string2) >>   > -- Cheers, Carlos.