diff mbox series

[1/3] nsis installer: List emulators in alphabetical order

Message ID 20220305105743.2384766-2-peter.maydell@linaro.org
State Superseded
Headers show
Series windows installer: Fix warnings, mouse-over descriptions, item order | expand

Commit Message

Peter Maydell March 5, 2022, 10:57 a.m. UTC
We currently list the emulators in the Windows installer's dialog
in an essentially random order (it's whatever glob.glob() returns
them to, which is filesystem-implementation-dependent). Add a
call to sorted() so they appear in alphabetical order.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 scripts/nsis.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Philippe Mathieu-Daudé March 5, 2022, 11:15 a.m. UTC | #1
On 5/3/22 11:57, Peter Maydell wrote:
> We currently list the emulators in the Windows installer's dialog
> in an essentially random order (it's whatever glob.glob() returns
> them to, which is filesystem-implementation-dependent). Add a
> call to sorted() so they appear in alphabetical order.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   scripts/nsis.py | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Stefan Weil March 5, 2022, 2:07 p.m. UTC | #2
Am 05.03.22 um 11:57 schrieb Peter Maydell:

> We currently list the emulators in the Windows installer's dialog
> in an essentially random order (it's whatever glob.glob() returns
> them to, which is filesystem-implementation-dependent). Add a
> call to sorted() so they appear in alphabetical order.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   scripts/nsis.py | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/nsis.py b/scripts/nsis.py
> index 5135a058316..383bef70332 100644
> --- a/scripts/nsis.py
> +++ b/scripts/nsis.py
> @@ -34,9 +34,9 @@ def main():
>           with open(
>               os.path.join(destdir + args.prefix, "system-emulations.nsh"), "w"
>           ) as nsh:
> -            for exe in glob.glob(
> +            for exe in sorted(glob.glob(
>                   os.path.join(destdir + args.prefix, "qemu-system-*.exe")
> -            ):
> +            )):
>                   exe = os.path.basename(exe)
>                   arch = exe[12:-4]
>                   nsh.write(


Reviewed-by: Stefan Weil <sw@weilnetz.de>
John Snow March 7, 2022, 7:25 p.m. UTC | #3
On Sat, Mar 5, 2022 at 5:57 AM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> We currently list the emulators in the Windows installer's dialog
> in an essentially random order (it's whatever glob.glob() returns
> them to, which is filesystem-implementation-dependent). Add a
> call to sorted() so they appear in alphabetical order.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  scripts/nsis.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/nsis.py b/scripts/nsis.py
> index 5135a058316..383bef70332 100644
> --- a/scripts/nsis.py
> +++ b/scripts/nsis.py
> @@ -34,9 +34,9 @@ def main():
>          with open(
>              os.path.join(destdir + args.prefix, "system-emulations.nsh"), "w"
>          ) as nsh:
> -            for exe in glob.glob(
> +            for exe in sorted(glob.glob(
>                  os.path.join(destdir + args.prefix, "qemu-system-*.exe")
> -            ):
> +            )):
>                  exe = os.path.basename(exe)
>                  arch = exe[12:-4]
>                  nsh.write(
> --
> 2.25.1
>

Do you care if this order is dependent upon the locale settings of the
host machine?

If you don't:

Reviewed-by: John Snow <jsnow@redhat.com>
Peter Maydell March 7, 2022, 8:16 p.m. UTC | #4
On Mon, 7 Mar 2022 at 19:25, John Snow <jsnow@redhat.com> wrote:
>
> On Sat, Mar 5, 2022 at 5:57 AM Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > We currently list the emulators in the Windows installer's dialog
> > in an essentially random order (it's whatever glob.glob() returns
> > them to, which is filesystem-implementation-dependent). Add a
> > call to sorted() so they appear in alphabetical order.
> >
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> > ---
> >  scripts/nsis.py | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/scripts/nsis.py b/scripts/nsis.py
> > index 5135a058316..383bef70332 100644
> > --- a/scripts/nsis.py
> > +++ b/scripts/nsis.py
> > @@ -34,9 +34,9 @@ def main():
> >          with open(
> >              os.path.join(destdir + args.prefix, "system-emulations.nsh"), "w"
> >          ) as nsh:
> > -            for exe in glob.glob(
> > +            for exe in sorted(glob.glob(
> >                  os.path.join(destdir + args.prefix, "qemu-system-*.exe")
> > -            ):
> > +            )):
> >                  exe = os.path.basename(exe)
> >                  arch = exe[12:-4]
> >                  nsh.write(
> > --
> > 2.25.1
> >
>
> Do you care if this order is dependent upon the locale settings of the
> host machine?

Everything we're sorting is lower-case letters only, so the locale
shouldn't matter.

-- PMM
diff mbox series

Patch

diff --git a/scripts/nsis.py b/scripts/nsis.py
index 5135a058316..383bef70332 100644
--- a/scripts/nsis.py
+++ b/scripts/nsis.py
@@ -34,9 +34,9 @@  def main():
         with open(
             os.path.join(destdir + args.prefix, "system-emulations.nsh"), "w"
         ) as nsh:
-            for exe in glob.glob(
+            for exe in sorted(glob.glob(
                 os.path.join(destdir + args.prefix, "qemu-system-*.exe")
-            ):
+            )):
                 exe = os.path.basename(exe)
                 arch = exe[12:-4]
                 nsh.write(