Mailinglist Archive: yast-devel (45 mails)

< Previous Next >
[yast-devel] Sorting in libstorage-ng

Hi,

as discussed yesterday after the daily call there is a small
change to libstorage-ng:

Change:

libstorage-ng now provides compare functions,
e.g. Partitionable::compare_by_name(), to sort devices. As a
countermove functions that retrieve vectors of devices no longer
sort the result.

Motivation:

- Allow to sort a combined list of e.g. disks and DASDs
individual retrieved by Disk::get_all() and Dasd::get_all().

- Allow special sorting, e.g. disks in general by name but USB
disks at the end (see

https://github.com/openSUSE/libstorage-ng/tree/master/integration-tests/misc/list-disks.py).

- Avoid sorting when it is unneeded.

Notes:

- The compare functions are C++ style: Compare for less than and
return a boolean. When used in Python or Ruby the result must
likely be mapped to ±1. The interface may change when C++
supports the spaceship operator.

- Most compare functions are trivial.

- Some functions in libstorage-ng still sort the result since
that is currently needed by the yast2-storage-ng testsuite
(LvmLvs AFAIS) and the expert partitioner.

ciao
Arvin

--
Arvin Schnell, <aschnell@xxxxxxxx>
Senior Software Engineer, Research & Development
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284
(AG Nürnberg)
Maxfeldstraße 5
90409 Nürnberg
Germany
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages