From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web08.7763.1610543730699817891 for ; Wed, 13 Jan 2021 05:15:32 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SCQ/eat+; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610543729; 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=MWFrLrtpk3Dsh22/Eev/rM1rrtncmL03NAMUJQA1+qY=; b=SCQ/eat+O90axhRVR8g2Af6jxDCZ/eTap6OCsNb2RTCB9DRnDcfeShqIsGBd5ucUzJlGOH Jb3gQyLpzSlAYYC+ilcv5PjQ468s99fn/D+3SNbz3ORTcRs9swosfGHiCfixqpHWs4YvLw inGo37ZCAJUGv6YA7zADOJx354gb/3A= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-256-r5K76vzBP2Wu8RZVMfGRfw-1; Wed, 13 Jan 2021 08:15:28 -0500 X-MC-Unique: r5K76vzBP2Wu8RZVMfGRfw-1 Received: by mail-wr1-f72.google.com with SMTP id n11so952869wro.7 for ; Wed, 13 Jan 2021 05:15:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MWFrLrtpk3Dsh22/Eev/rM1rrtncmL03NAMUJQA1+qY=; b=UrdgTCfR7vxjm1BAEFOMB0R9b4X4qwO8jk+5PgqFowHHZwXTDPKOq6VnZG0p94yTNP vzJlR6pnrNl0afJOnrhG5X4FaeovG2SEwTdV50FfdIUXw8rt4h9h4mfVxMyLezK4y1pJ 4GmY8z8dA938LgDV+5L44PRlsprxPw/Hr2S9/FVRIt+lHFzmmX0qH+BLWePU589GcXpl g9Msb4mRnypR3kNFT4OQkRg0GtAeZ/1AZElSyI3LpZBzcAnwclrQ6UPfBgFfMdSxdD/j 50D9nqN8j6bw1CQ0zMhV6Eejh6siLRAvo1PRJtoSwVaqSYK2UnJ2kQFsdLV7bF2rz924 iqaQ== X-Gm-Message-State: AOAM533QxFCPql5L14E2+QLHKym8w7kCQrhxfEBR0B27IyJ31gSpzkT3 PErRB1GBmLoXuxA1ZcGBFmp4fGGd1QQ8dKieBBzKHYhDQbRM93ikrDkAAqrhH6whqHGJfkeK//V v1/6Ekd5ma/dEow== X-Received: by 2002:a5d:5589:: with SMTP id i9mr2665697wrv.18.1610543727007; Wed, 13 Jan 2021 05:15:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZ4vv2DyVHasOVypDuph3DsJdSEGhvBDeJKLgXkoBg62puyKHdt4CPZqw+Igg5cCIJMQDGrw== X-Received: by 2002:a5d:5589:: with SMTP id i9mr2665676wrv.18.1610543726783; Wed, 13 Jan 2021 05:15:26 -0800 (PST) Return-Path: Received: from [192.168.1.36] (190.red-83-57-173.dynamicip.rima-tde.net. [83.57.173.190]) by smtp.gmail.com with ESMTPSA id z21sm2860080wmk.20.2021.01.13.05.15.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Jan 2021 05:15:26 -0800 (PST) Subject: Re: [PATCH v2 07/10] ShellPkg/Ls: sort output by FileName in non-SFO mode To: Laszlo Ersek , devel@edk2.groups.io Cc: Ray Ni , Zhichao Gao References: <20210113085453.10168-1-lersek@redhat.com> <20210113085453.10168-8-lersek@redhat.com> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: Date: Wed, 13 Jan 2021 14:15:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210113085453.10168-8-lersek@redhat.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 1/13/21 9:54 AM, Laszlo Ersek wrote: > Sorting the LS output in non-SFO mode by FileName is best demonstrated > with two examples. > > (1a) Before: > >> FS2:\> dir -r apps >> Directory of: FS2:\apps\ >> 01/01/1970 01:00 r 0 . >> 12/22/2020 17:53 4,096 X64 >> 12/22/2020 17:53 4,096 AARCH64 >> 01/01/1970 01:00 r 0 .. >> 12/22/2020 17:53 4,096 IA32 >> 0 File(s) 0 bytes >> 5 Dir(s) >> Directory of: FS2:\apps\X64\ >> 12/22/2020 17:52 18,752 DumpDynPcd.efi >> 12/22/2020 17:52 34,240 SmiHandlerProfileInfo.efi >> 01/01/1970 01:00 r 0 . >> 12/22/2020 17:52 11,456 VariableInfo.efi >> 12/22/2020 17:52 26,304 MemoryProfileInfo.efi >> 12/22/2020 17:53 126,656 AcpiViewApp.efi >> 12/22/2020 17:53 38,784 Cpuid.efi >> 01/01/1970 01:00 r 0 .. >> 6 File(s) 256,192 bytes >> 2 Dir(s) >> Directory of: FS2:\apps\AARCH64\ >> 12/22/2020 17:52 32,768 DumpDynPcd.efi >> 01/01/1970 01:00 r 0 . >> 12/22/2020 17:52 20,480 VariableInfo.efi >> 12/22/2020 17:52 40,960 MemoryProfileInfo.efi >> 12/22/2020 17:53 139,264 AcpiViewApp.efi >> 01/01/1970 01:00 r 0 .. >> 4 File(s) 233,472 bytes >> 2 Dir(s) >> Directory of: FS2:\apps\IA32\ >> 12/22/2020 17:52 17,344 DumpDynPcd.efi >> 12/22/2020 17:52 30,720 SmiHandlerProfileInfo.efi >> 01/01/1970 01:00 r 0 . >> 12/22/2020 17:52 10,880 VariableInfo.efi >> 12/22/2020 17:52 24,192 MemoryProfileInfo.efi >> 12/22/2020 17:53 105,536 AcpiViewApp.efi >> 12/22/2020 17:53 36,096 Cpuid.efi >> 01/01/1970 01:00 r 0 .. >> 6 File(s) 224,768 bytes >> 2 Dir(s) > > (1b) After: > >> FS2:\> dir -r apps >> Directory of: FS2:\apps\ >> 01/01/1970 01:00 r 0 . >> 01/01/1970 01:00 r 0 .. >> 12/22/2020 17:53 4,096 AARCH64 >> 12/22/2020 17:53 4,096 IA32 >> 12/22/2020 17:53 4,096 X64 >> 0 File(s) 0 bytes >> 5 Dir(s) >> Directory of: FS2:\apps\X64\ >> 01/01/1970 01:00 r 0 . >> 01/01/1970 01:00 r 0 .. >> 12/22/2020 17:53 126,656 AcpiViewApp.efi >> 12/22/2020 17:53 38,784 Cpuid.efi >> 12/22/2020 17:52 18,752 DumpDynPcd.efi >> 12/22/2020 17:52 26,304 MemoryProfileInfo.efi >> 12/22/2020 17:52 34,240 SmiHandlerProfileInfo.efi >> 12/22/2020 17:52 11,456 VariableInfo.efi >> 6 File(s) 256,192 bytes >> 2 Dir(s) >> Directory of: FS2:\apps\AARCH64\ >> 01/01/1970 01:00 r 0 . >> 01/01/1970 01:00 r 0 .. >> 12/22/2020 17:53 139,264 AcpiViewApp.efi >> 12/22/2020 17:52 32,768 DumpDynPcd.efi >> 12/22/2020 17:52 40,960 MemoryProfileInfo.efi >> 12/22/2020 17:52 20,480 VariableInfo.efi >> 4 File(s) 233,472 bytes >> 2 Dir(s) >> Directory of: FS2:\apps\IA32\ >> 01/01/1970 01:00 r 0 . >> 01/01/1970 01:00 r 0 .. >> 12/22/2020 17:53 105,536 AcpiViewApp.efi >> 12/22/2020 17:53 36,096 Cpuid.efi >> 12/22/2020 17:52 17,344 DumpDynPcd.efi >> 12/22/2020 17:52 24,192 MemoryProfileInfo.efi >> 12/22/2020 17:52 30,720 SmiHandlerProfileInfo.efi >> 12/22/2020 17:52 10,880 VariableInfo.efi >> 6 File(s) 224,768 bytes >> 2 Dir(s) > > (2a) Before: > >> FS2:\> dir apps\*\*.efi >> Directory of: FS2:\apps\*\ >> 12/22/2020 17:52 18,752 DumpDynPcd.efi >> 12/22/2020 17:52 34,240 SmiHandlerProfileInfo.efi >> 12/22/2020 17:52 11,456 VariableInfo.efi >> 12/22/2020 17:52 26,304 MemoryProfileInfo.efi >> 12/22/2020 17:53 126,656 AcpiViewApp.efi >> 12/22/2020 17:53 38,784 Cpuid.efi >> 12/22/2020 17:52 32,768 DumpDynPcd.efi >> 12/22/2020 17:52 20,480 VariableInfo.efi >> 12/22/2020 17:52 40,960 MemoryProfileInfo.efi >> 12/22/2020 17:53 139,264 AcpiViewApp.efi >> 12/22/2020 17:52 17,344 DumpDynPcd.efi >> 12/22/2020 17:52 30,720 SmiHandlerProfileInfo.efi >> 12/22/2020 17:52 10,880 VariableInfo.efi >> 12/22/2020 17:52 24,192 MemoryProfileInfo.efi >> 12/22/2020 17:53 105,536 AcpiViewApp.efi >> 12/22/2020 17:53 36,096 Cpuid.efi >> 16 File(s) 714,432 bytes >> 0 Dir(s) > > (2b) After: > >> FS2:\> dir apps\*\*.efi >> Directory of: FS2:\apps\*\ >> 12/22/2020 17:53 126,656 AcpiViewApp.efi >> 12/22/2020 17:53 139,264 AcpiViewApp.efi >> 12/22/2020 17:53 105,536 AcpiViewApp.efi >> 12/22/2020 17:53 38,784 Cpuid.efi >> 12/22/2020 17:53 36,096 Cpuid.efi >> 12/22/2020 17:52 18,752 DumpDynPcd.efi >> 12/22/2020 17:52 32,768 DumpDynPcd.efi >> 12/22/2020 17:52 17,344 DumpDynPcd.efi >> 12/22/2020 17:52 26,304 MemoryProfileInfo.efi >> 12/22/2020 17:52 40,960 MemoryProfileInfo.efi >> 12/22/2020 17:52 24,192 MemoryProfileInfo.efi >> 12/22/2020 17:52 34,240 SmiHandlerProfileInfo.efi >> 12/22/2020 17:52 30,720 SmiHandlerProfileInfo.efi >> 12/22/2020 17:52 11,456 VariableInfo.efi >> 12/22/2020 17:52 20,480 VariableInfo.efi >> 12/22/2020 17:52 10,880 VariableInfo.efi >> 16 File(s) 714,432 bytes >> 0 Dir(s) > > (In example (2), note that the sorting is stable; that is, whatever order > is established between identical FileNames by ShellOpenFileMetaArg(), it > is preserved by ShellSortFileList().) > > Cc: Philippe Mathieu-Daudé > Cc: Ray Ni > Cc: Zhichao Gao > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3151 > Signed-off-by: Laszlo Ersek > Reviewed-by: Zhichao Gao > --- > > Notes: > v2: > - no changes > - pick up Zhichao's R-b > > ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) Reviewed-by: Philippe Mathieu-Daude