Subject: Re: bug#42289: recursive import does not dort alphabetically

From: zimoun <[email-masked]>
Date: Thu, 16 Jul 2020 13:35:23 +0200

Dear Hartmut,

On Wed, 15 Jul 2020 at 21:10, Hartmut Goebel <[email-masked]> wrote

> Many modules are sorted and some packages even contain a comment asking
> for being sorted. So I had the impression this is good practice.

I am not sure by the "many". :-)
Even gnu/packages/crate-io.scm which explicitly asks:

;;; Please: Try to add new module packages in alphabetic order.

and it is not really sorted. :-)

  cat crates-io.scm | grep 'define-public' | sort --check
  sort: -:6: disorder: (define-public rust-afl-0.5

> Also scanning through the file is easier for humans if packages are
> sorted - depends on personal work style.

It appears to me as a "good practise" too.  On the other hand,
personally I always scan the packages with "ag" (inside Emacs).

However, it is not the point since your initial request is about
alphabetical sort of "guix import"; which seems better than arbitrary
order (dependency order).  Whatever if gnu/packages/foo.scm is sorted or
not.

If "guix import" returns an alphanumerical sorted list, it is easier and
it does not bother the unsorted modules since the packages are new.

All the best,
simon