#466971 dpkg-query -L should sort the file list

Package:
dpkg
Source:
dpkg
Description:
Debian package management system
Submitter:
Jari Aalto
Date:
2025-07-16 13:01:02 UTC
Severity:
wishlist
#466971#5
Date:
2008-02-22 08:07:28 UTC
From:
To:
Please adjust the option -L so that the listing is presented
alphabetically. In example below, the maekrd line "!"  is detached
from the rest of the manpages.

    $ dpkg -L cvsutils

    /.
    /usr
    /usr/bin
    /usr/bin/cvsco
    /usr/bin/cvsdiscard
    /usr/bin/cvspurge
    /usr/bin/cvstrim
    /usr/bin/cvsu
    /usr/bin/cvsdo
    /usr/bin/cvschroot
    /usr/bin/cvsnotag
    /usr/share
    /usr/share/man
    /usr/share/man/man1
!   /usr/share/man/man1/cvsutils.1.gz
    /usr/share/doc
    /usr/share/doc/cvsutils
    /usr/share/doc/cvsutils/changelog.gz
    /usr/share/doc/cvsutils/NEWS.gz
    /usr/share/doc/cvsutils/AUTHORS
    /usr/share/doc/cvsutils/TODO
    /usr/share/doc/cvsutils/THANKS
    /usr/share/doc/cvsutils/copyright
    /usr/share/doc/cvsutils/changelog.Debian.gz
    /usr/share/doc/cvsutils/README.gz
    /usr/share/man/man1/cvsdo.1.gz
    /usr/share/man/man1/cvsu.1.gz
    /usr/share/man/man1/cvstrim.1.gz
    /usr/share/man/man1/cvsco.1.gz
    /usr/share/man/man1/cvspurge.1.gz
    /usr/share/man/man1/cvschroot.1.gz
    /usr/share/man/man1/cvsdiscard.1.gz
    /usr/share/man/man1/cvsnotag.1.gz

#466971#10
Date:
2008-02-22 08:25:04 UTC
From:
To:
user dpkg@packages.debian.org
usertag 466971 dpkg-query
severity 466971 wishlist
retitle 466971 dpkg-query -L should sort the file list
thanks

Rather the rest of the man pages are detached from the one marked with
"!"... and they are detached because they are symlinks. Symlinks always
appear at the end of dpkg -L. I don't know if there's a good reason for
this or if this is simply an implementation detail that leacks into the
user interface.

Cheers,

#466971#19
Date:
2008-02-22 21:42:35 UTC
From:
To:
Raphael Hertzog writes ("Bug#466971: dpkg [dpkg] lists output of option -L in alphabetical  order"):

dpkg -L prints the files in the order they are in the file lists in
the dpkg databases.

The files are in the database in the order that they came in the
package, and I think it would be bad to perturb that (although I
haven't thought it through carefully).  The files are in the package
in that order so that when a symlink is installed by atomic rename
during unpack, the file which it refers to already exists.

I think the right answer is for dpkg -L to sort its output (perhaps
with an option to suppress this if desired).

Ian.

#466971#24
Date:
2008-02-23 10:19:51 UTC
From:
To:
* Fri 2008-02-22 Ian Jackson <ian@davenant.greenend.org.uk> INBOX
The -L listing is very ofter used to check where "are" the files in
the package. For human consumption, the alphabetical order is very
important. Any other order is distracting.

The other way round. Please make the sorted listing the default, and
add separate option to list the RAW order[*]

[*] On top of my head, I don't know what program would benefit from
the raw listing, because it would still need to test [ -h "$path" ] to
determine if any of those are symlinks or not.

Jari

#466971#29
Date:
2008-03-08 13:35:00 UTC
From:
To:
Jari Aalto writes ("Bug#466971: dpkg [dpkg] lists output of option -L in alphabetical  order"):

Yes, I agree.

I think you must have misunderstood me.  That's exactly what I meant.

(To `suppress' something is to make it not happen, so if I say
`perhaps with an option to suppress [sorting]' I mean that there will
be an option to get unsorted output and implicitly the sorted output
is the default.)

Ian.

#466971#34
Date:
2021-09-22 04:26:56 UTC
From:
To:
Hello,

Good morning,

We have gone through your samples from a partner and Here is our  Order
List. Please do bear in mind that we are very much in  need of this
order, quote your competitive prices.

Kindly send the Order confirmation.

Your early reply will be much appreciated.

Best Regards,

Maryanah Erwin.

PT FINDORA INTERNUSA

Jln Pahlawan 66 Kec. Arjawinangun

45162 CIREBON West-Java INDONESIA

tel : +62 231 357334

fax: +62 231 357260

email: marketing@findora.com

#466971#39
Date:
2025-07-16 12:51:09 UTC
From:
To:
I agree with automatic sorting of the output.

The -L option is useful for both humans and scripts, in both cases
sorting is either preferable or causes no problems (that I can think of.)

It can't be relied on that packages' internal file lists are in a
legible order.