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 B0DA93858C5F for ; Thu, 18 May 2023 13:03:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B0DA93858C5F 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=1684415012; 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=9kfBzqtUsFTzXCS5ZQ98FtJaB0JCwgpq02d7neImgrU=; b=IIiNKaw/4fVkMWUShKiNhEbND6KIvFRdgaAD9nkAxrIYF+sVfln6cCI91u2mxhjBUUO/hA 2chmm7K4UJWjjOkbv0wF/mhQBEOTWuRMez3vEZ2q+rkzvdQRJnOs56TUamf+d6q+ou+POI 2tEZZeFO34skJ/xPNNnCDPtO4hs2zX8= Received: from mail-yb1-f199.google.com (mail-yb1-f199.google.com [209.85.219.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-617-I5IPc7TCOLKWPV8Q1biLHA-1; Thu, 18 May 2023 09:03:31 -0400 X-MC-Unique: I5IPc7TCOLKWPV8Q1biLHA-1 Received: by mail-yb1-f199.google.com with SMTP id 3f1490d57ef6-ba83fed51adso3562331276.0 for ; Thu, 18 May 2023 06:03:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684415010; x=1687007010; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9kfBzqtUsFTzXCS5ZQ98FtJaB0JCwgpq02d7neImgrU=; b=R0HLb88Jk8L+bN/Cqj1Ze9i/EsklzYRmhHRPKvnUhWWWvsa1PGjtp/fB10NN/2BX8J NVR5QwSPXT3O8oMv7tN9NErXefaquYp9f/MEZSs0jS1pVewyqPRAiCqdIzFfdvCvnc4N qne8+1ofK5JJW8RoLUH0lFEiEjce/X0BI/ZkuVYZ1G+xSzNPj9ek9qqdb6mXLPM/lyOW EjmUCxn4bg3v+JVW8EBxysAC+6E2zsJcrC8TJVDZLAdKPBK5hJ8FUd1ST/lvKF/Nyh8Q RyHcc+sF+2sZT2OW+LLm1MdFrfLSh4/B/GzHabR2awDymfcYF0Y8hCMSzCH5e62uwDsf kniw== X-Gm-Message-State: AC+VfDwGFysehcIMWuKwLrQ6t8IQNi4ELNq2uAxFa92WlLeTOD1/6D42 GoBoSxSXagoGZ7/pZsjaQHxpmGQtmxuX0XKccvnBvo/dcWV/tpqRKEQiIm0/RTiUIqMrC9JYgH+ e8zwwISlF7a0m+n3jnLLz/rGPa95jnWn7wNV3JouZ/VdOmpKG3YOrYpW6DdM2bGSVhdWM0JJeF0 Milg== X-Received: by 2002:a25:aaa1:0:b0:ba7:24e8:bcf8 with SMTP id t30-20020a25aaa1000000b00ba724e8bcf8mr1545534ybi.49.1684415009885; Thu, 18 May 2023 06:03:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ62uiahfAYM0fSRg5Ag8HtUbCF5TDt1te9aN0NmRuA4umBoQoDJTqNfsHrgnIfVPARU8YSSGw== X-Received: by 2002:a25:aaa1:0:b0:ba7:24e8:bcf8 with SMTP id t30-20020a25aaa1000000b00ba724e8bcf8mr1545476ybi.49.1684415009211; Thu, 18 May 2023 06:03:29 -0700 (PDT) Received: from DESKTOP-1DH6NSL.localdomain ([198.48.244.52]) by smtp.gmail.com with ESMTPSA id a3-20020a81bb43000000b0054c0a8ceb2fsm406033ywl.28.2023.05.18.06.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 May 2023 06:03:28 -0700 (PDT) From: Carlos O'Donell To: libc-alpha@sourceware.org, siddhesh@gotplt.org Cc: Carlos O'Donell Subject: [PATCH 1/5] scripts: sort-makefile-lines.py Date: Thu, 18 May 2023 09:03:21 -0400 Message-Id: <20230518130325.59309-2-carlos@redhat.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230518130325.59309-1-carlos@redhat.com> References: <20230518130325.59309-1-carlos@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.6 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,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: We must return < 0, 0, or > 0 as the result of the comparison function for cmp_to_key() to work correctly across all comparisons. --- 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) -- 2.40.0