Hello community, here is the log from the commit of package libstorage-ng for openSUSE:Factory checked in at 2020-01-04 19:20:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old) and /work/SRC/openSUSE:Factory/.libstorage-ng.new.6675 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libstorage-ng" Sat Jan 4 19:20:57 2020 rev:70 rq:760719 version:4.2.44 Changes: -------- --- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes 2019-12-14 12:04:33.479391744 +0100 +++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.6675/libstorage-ng.changes 2020-01-04 19:21:06.405131003 +0100 @@ -1,0 +2,29 @@ +Fri Jan 3 16:05:56 UTC 2020 - [email protected] + +- merge gh#openSUSE/libstorage-ng#692 +- improved sort-key for block devices (for bsc#1140018) +- extended documentation +- 4.2.44 + +-------------------------------------------------------------------- +Thu Dec 19 10:46:06 UTC 2019 - [email protected] + +- merge gh#openSUSE/libstorage-ng#690 +- provide sort-key for device name (for bsc#1140018) +- adapted utility programs to changes in networkx 2.4 +- removed obsolete variable +- 4.2.43 + +-------------------------------------------------------------------- +Wed Dec 18 22:39:25 UTC 2019 - [email protected] + +- Translated using Weblate (Finnish) (bsc#1149754) +- 4.2.42 + +-------------------------------------------------------------------- +Sun Dec 15 17:47:27 UTC 2019 - [email protected] + +- Translated using Weblate (German) (bsc#1149754) +- 4.2.41 + +-------------------------------------------------------------------- Old: ---- libstorage-ng-4.2.40.tar.xz New: ---- libstorage-ng-4.2.44.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage-ng.spec ++++++ --- /var/tmp/diff_new_pack.SEne22/_old 2020-01-04 19:21:06.985131260 +0100 +++ /var/tmp/diff_new_pack.SEne22/_new 2020-01-04 19:21:06.989131262 +0100 @@ -1,7 +1,7 @@ # # spec file for package libstorage-ng # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %define libname %{name}1 Name: libstorage-ng -Version: 4.2.40 +Version: 4.2.44 Release: 0 Summary: Library for storage management License: GPL-2.0-only ++++++ libstorage-ng-4.2.40.tar.xz -> libstorage-ng-4.2.44.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/LIBVERSION new/libstorage-ng-4.2.44/LIBVERSION --- old/libstorage-ng-4.2.40/LIBVERSION 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/LIBVERSION 2020-01-03 17:05:56.000000000 +0100 @@ -1 +1 @@ -1.22.1 +1.23.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/VERSION new/libstorage-ng-4.2.44/VERSION --- old/libstorage-ng-4.2.40/VERSION 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/VERSION 2020-01-03 17:05:56.000000000 +0100 @@ -1 +1 @@ -4.2.40 +4.2.44 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/bindings/storage-catches.i new/libstorage-ng-4.2.44/bindings/storage-catches.i --- old/libstorage-ng-4.2.40/bindings/storage-catches.i 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/bindings/storage-catches.i 2020-01-03 17:05:56.000000000 +0100 @@ -234,6 +234,7 @@ %catches(storage::Exception) storage::Device::compare_by_name(const Device *lhs, const Device *rhs); %catches(storage::Exception) storage::Device::copy_to_devicegraph(Devicegraph *devicegraph) const; %catches(storage::Exception) storage::Device::detect_resize_info() const; +%catches(storage::Exception) storage::Device::get_name_sort_key() const; %catches(storage::Exception) storage::Devicegraph::check(const CheckCallbacks *check_callbacks=nullptr) const; %catches(storage::DeviceNotFoundBySid) storage::Devicegraph::find_device(sid_t sid); %catches(storage::DeviceNotFoundBySid) storage::Devicegraph::find_device(sid_t sid) const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/po/de.po new/libstorage-ng-4.2.44/po/de.po --- old/libstorage-ng-4.2.40/po/de.po 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/po/de.po 2020-01-03 17:05:56.000000000 +0100 @@ -14,10 +14,10 @@ "Project-Id-Version: YaST (@memory@)\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-04 09:26+0200\n" -"PO-Revision-Date: 2019-07-03 14:50+0000\n" +"PO-Revision-Date: 2019-12-15 19:54+0000\n" "Last-Translator: Sarah Kriesch <[email protected]>\n" -"Language-Team: German <https://l10n.opensuse.org/projects/libstorage/ng-" -"master/de/>\n" +"Language-Team: German <https://l10n.opensuse.org/projects/libstorage/" +"ng-master/de/>\n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -2201,9 +2201,8 @@ msgstr "PiB" #. TRANSLATORS: name of object -#, fuzzy msgid "Plain Encryption" -msgstr "Verschlüsselung" +msgstr "Einfache Verschlüsselung" #. TRANSLATORS: error message #, c-format @@ -2349,14 +2348,12 @@ msgstr "Untersuchung der Partitionen auf %s fehlgeschlagen" #. TRANSLATORS: progress message -#, fuzzy msgid "Probing plain encryptions" -msgstr "Partitionen werden untersucht" +msgstr "Einfache Verschlüsselungen werden getestet" #. TRANSLATORS: error message -#, fuzzy msgid "Probing plain encryptions failed" -msgstr "Untersuchen von Partitionen fehlgeschlagen" +msgstr "Testen von einfachen Verschlüsselungen fehlgeschlagen" #. TRANSLATORS: error message #, c-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/po/fi.po new/libstorage-ng-4.2.44/po/fi.po --- old/libstorage-ng-4.2.40/po/fi.po 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/po/fi.po 2020-01-03 17:05:56.000000000 +0100 @@ -12,16 +12,16 @@ "Project-Id-Version: libstorage.fi\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-04 09:26+0200\n" -"PO-Revision-Date: 2019-05-02 06:04+0000\n" -"Last-Translator: Tommi Nieminen <[email protected]>\n" -"Language-Team: Finnish <https://l10n.opensuse.org/projects/libstorage/ng-" -"master/fi/>\n" +"PO-Revision-Date: 2019-12-19 00:54+0000\n" +"Last-Translator: Kimmo Kujansuu <[email protected]>\n" +"Language-Team: Finnish <https://l10n.opensuse.org/projects/libstorage/" +"ng-master/fi/>\n" "Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.3\n" +"X-Generator: Weblate 3.6.1\n" msgid "" "\n" @@ -100,7 +100,7 @@ #. %1$s is replaced by logical volume name (e.g. root), #. %2$s is replaced by size (e.g. 2GiB), #. %3$s is replaced by volume group name (e.g. system) -#, fuzzy, c-format +#, c-format msgid "Activate thin pool logical volume %1$s (%2$s) on volume group %3$s" msgstr "Alustetaan looginen taltio %1$s (%2$s) tiedostojärjestelmällä %3$s" @@ -156,7 +156,7 @@ #. %1$s is replaced by logical volume name (e.g. root), #. %2$s is replaced by size (e.g. 2GiB), #. %3$s is replaced by volume group name (e.g. system) -#, fuzzy, c-format +#, c-format msgid "Activating thin pool logical volume %1$s (%2$s) on volume group %3$s" msgstr "Alustetaan looginen taltio %1$s (%2$s) tiedostojärjestelmällä %3$s" @@ -165,9 +165,9 @@ #. %2$s is replaced by the device size (e.g. 2.0 GiB), #. %3$s is replaced by one or more devices (e.g /dev/sda1 (2.0 GiB) #. and /dev/sdb2 (2.0 GiB)) -#, fuzzy, c-format +#, c-format msgid "Add %1$s (%2$s) to btrfs on %3$s" -msgstr "Lisää %1$s taltioryhmään %2$s" +msgstr "Lisää %1$s (%2$s) btrfs taltioon %3$s" #. TRANSLATORS: displayed before action, #. %1$s is replaced by device name (e.g. /dev/sdd), @@ -214,9 +214,9 @@ #. %2$s is replaced by the device size (e.g. 2.0 GiB), #. %3$s is replaced by one or more devices (e.g /dev/sda1 (2.0 GiB) #. and /dev/sdb2 (2.0 GiB)) -#, fuzzy, c-format +#, c-format msgid "Adding %1$s (%2$s) to btrfs on %3$s" -msgstr "Lisätään %1$s kohteeseen %2$s" +msgstr "Lisätään %1$s (%2$s) btrfs -kohteeseen %3$s" #. TRANSLATORS: displayed during action, #. %1$s is replaced by device name (e.g. /dev/sdd), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/BcacheImpl.cc new/libstorage-ng-4.2.44/storage/Devices/BcacheImpl.cc --- old/libstorage-ng-4.2.40/storage/Devices/BcacheImpl.cc 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/BcacheImpl.cc 2020-01-03 17:05:56.000000000 +0100 @@ -110,10 +110,10 @@ string - Bcache::Impl::get_sort_key() const + Bcache::Impl::get_name_sort_key() const { static const vector<NameSchema> name_schemata = { - NameSchema(regex(DEV_DIR "/bcache([0-9]+)", regex::extended), { { 3, '0' } }), + NameSchema(regex(DEV_DIR "/bcache([0-9]+)", regex::extended), { { PadInfo::N1, 3 } }), }; return format_to_name_schemata(get_name(), name_schemata); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/BcacheImpl.h new/libstorage-ng-4.2.44/storage/Devices/BcacheImpl.h --- old/libstorage-ng-4.2.40/storage/Devices/BcacheImpl.h 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/BcacheImpl.h 2020-01-03 17:05:56.000000000 +0100 @@ -59,7 +59,7 @@ virtual string get_pretty_classname() const override; - virtual string get_sort_key() const override; + virtual string get_name_sort_key() const override; static bool is_valid_name(const string& name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/BlkDevice.h new/libstorage-ng-4.2.44/storage/Devices/BlkDevice.h --- old/libstorage-ng-4.2.40/storage/Devices/BlkDevice.h 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/BlkDevice.h 2020-01-03 17:05:56.000000000 +0100 @@ -260,6 +260,8 @@ /** * Compare (less than) two BlkDevices by DM table name. + * + * The comparison is locale unaware. */ static bool compare_by_dm_table_name(const BlkDevice* lhs, const BlkDevice* rhs); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/BlkDeviceImpl.h new/libstorage-ng-4.2.44/storage/Devices/BlkDeviceImpl.h --- old/libstorage-ng-4.2.40/storage/Devices/BlkDeviceImpl.h 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/BlkDeviceImpl.h 2020-01-03 17:05:56.000000000 +0100 @@ -57,7 +57,7 @@ virtual string get_displayname() const override { return get_name(); } - virtual string get_sort_key() const override { return get_name(); } + virtual string get_name_sort_key() const override { return get_name(); } virtual void check(const CheckCallbacks* check_callbacks) const override; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/DasdImpl.cc new/libstorage-ng-4.2.44/storage/Devices/DasdImpl.cc --- old/libstorage-ng-4.2.40/storage/Devices/DasdImpl.cc 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/DasdImpl.cc 2020-01-03 17:05:56.000000000 +0100 @@ -99,11 +99,11 @@ string - Dasd::Impl::get_sort_key() const + Dasd::Impl::get_name_sort_key() const { static const vector<NameSchema> name_schemata = { - NameSchema(regex(DEV_DIR "/dasd([a-z]+)", regex::extended), { { 4, ' ' } }), - NameSchema(regex(DEV_DIR "/vd([a-z]+)", regex::extended), { { 4, ' ' } }) + NameSchema(regex(DEV_DIR "/dasd([a-z]+)", regex::extended), { { PadInfo::A1, 5, } }), + NameSchema(regex(DEV_DIR "/vd([a-z]+)", regex::extended), { { PadInfo::A1, 5 } }) }; return format_to_name_schemata(get_name(), name_schemata); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/DasdImpl.h new/libstorage-ng-4.2.44/storage/Devices/DasdImpl.h --- old/libstorage-ng-4.2.40/storage/Devices/DasdImpl.h 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/DasdImpl.h 2020-01-03 17:05:56.000000000 +0100 @@ -56,7 +56,7 @@ virtual string get_pretty_classname() const override; - virtual string get_sort_key() const override; + virtual string get_name_sort_key() const override; virtual Impl* clone() const override { return new Impl(*this); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/Device.cc new/libstorage-ng-4.2.44/storage/Devices/Device.cc --- old/libstorage-ng-4.2.40/storage/Devices/Device.cc 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/Device.cc 2020-01-03 17:05:56.000000000 +0100 @@ -408,7 +408,14 @@ bool Device::compare_by_name(const Device* lhs, const Device* rhs) { - return lhs->get_impl().get_sort_key() < rhs->get_impl().get_sort_key(); + return lhs->get_name_sort_key() < rhs->get_name_sort_key(); + } + + + string + Device::get_name_sort_key() const + { + return get_impl().get_name_sort_key(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/Device.h new/libstorage-ng-4.2.44/storage/Devices/Device.h --- old/libstorage-ng-4.2.40/storage/Devices/Device.h 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/Device.h 2020-01-03 17:05:56.000000000 +0100 @@ -192,10 +192,32 @@ * The comparison fulfills strict weak ordering. The exact ordering * may change in future versions. * + * The comparison is locale unaware. + * * @throw Exception */ static bool compare_by_name(const Device* lhs, const Device* rhs); + /** + * Get a sort-key based on the device name. So far only + * avaliable for BlkDevices and LvmVgs. For other types the + * sort-key is empty. + * + * The sorting based on the sort-key sorts to alphabetical + * order with some exceptions. E.g. The disk /dev/sdz is in + * front of /dev/sdaa and the partition /dev/sda2 is in front + * of /dev/sda10. + * + * The sorting based on the sort-key may depend on the used + * locale. + * + * The sort-key and the exact ordering may change in future + * versions. + * + * @throw Exception + */ + std::string get_name_sort_key() const; + Devicegraph* get_devicegraph(); const Devicegraph* get_devicegraph() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/DeviceImpl.h new/libstorage-ng-4.2.44/storage/Devices/DeviceImpl.h --- old/libstorage-ng-4.2.40/storage/Devices/DeviceImpl.h 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/DeviceImpl.h 2020-01-03 17:05:56.000000000 +0100 @@ -99,7 +99,7 @@ virtual string get_displayname() const = 0; - virtual string get_sort_key() const { return ""; } + virtual string get_name_sort_key() const { return ""; } virtual void save(xmlNode* node) const = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/DiskImpl.cc new/libstorage-ng-4.2.44/storage/Devices/DiskImpl.cc --- old/libstorage-ng-4.2.40/storage/Devices/DiskImpl.cc 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/DiskImpl.cc 2020-01-03 17:05:56.000000000 +0100 @@ -88,19 +88,20 @@ string - Disk::Impl::get_sort_key() const + Disk::Impl::get_name_sort_key() const { // TODO maybe generally pad numbers static const vector<NameSchema> name_schemata = { - NameSchema(regex(DEV_DIR "/sd([a-z]+)", regex::extended), { { 4, ' ' } }), - NameSchema(regex(DEV_DIR "/vd([a-z]+)", regex::extended), { { 4, ' ' } }), - NameSchema(regex(DEV_DIR "/mmcblk([0-9]+)", regex::extended), { { 3, '0' } }), - NameSchema(regex(DEV_DIR "/rsxx([0-9]+)", regex::extended), { { 3, '0' } }), - NameSchema(regex(DEV_DIR "/pmem([0-9]+)s?", regex::extended), { { 3, '0' } }), - NameSchema(regex(DEV_DIR "/pmem([0-9]+)\\.([0-9]+)s?", regex::extended), { { 3, '0' }, { 3, '0' } }), - NameSchema(regex(DEV_DIR "/nvme([0-9]+)n([0-9]+)", regex::extended), { { 3, '0' }, { 3, '0' } }), - NameSchema(regex(DEV_DIR "/xvd([a-z]+)", regex::extended), { { 4, ' ' } }), + NameSchema(regex(DEV_DIR "/sd([a-z]+)", regex::extended), { { PadInfo::A1, 5 } }), + NameSchema(regex(DEV_DIR "/vd([a-z]+)", regex::extended), { { PadInfo::A1, 5 } }), + NameSchema(regex(DEV_DIR "/mmcblk([0-9]+)", regex::extended), { { PadInfo::N1, 3 } }), + NameSchema(regex(DEV_DIR "/rsxx([0-9]+)", regex::extended), { { PadInfo::N1, 3 } }), + NameSchema(regex(DEV_DIR "/pmem([0-9]+)s?", regex::extended), { { PadInfo::N1, 3 } }), + NameSchema(regex(DEV_DIR "/pmem([0-9]+)\\.([0-9]+)s?", regex::extended), { { PadInfo::N1, 3 }, { PadInfo::N1, 3 } }), + NameSchema(regex(DEV_DIR "/nvme([0-9]+)n([0-9]+)", regex::extended), { { PadInfo::N1, 3 }, { PadInfo::N1, 3 } }), + NameSchema(regex(DEV_DIR "/xvd([a-z]+)", regex::extended), { { PadInfo::A1, 5 } }), + NameSchema(regex(DEV_DIR "/ram([0-9]+)", regex::extended), { { PadInfo::N1, 3 } }) }; return format_to_name_schemata(get_name(), name_schemata); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/DiskImpl.h new/libstorage-ng-4.2.44/storage/Devices/DiskImpl.h --- old/libstorage-ng-4.2.40/storage/Devices/DiskImpl.h 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/DiskImpl.h 2020-01-03 17:05:56.000000000 +0100 @@ -61,7 +61,7 @@ virtual string get_pretty_classname() const override; - virtual string get_sort_key() const override; + virtual string get_name_sort_key() const override; virtual bool is_usable_as_blk_device() const override; virtual bool is_usable_as_partitionable() const override; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/LvmLv.h new/libstorage-ng-4.2.44/storage/Devices/LvmLv.h --- old/libstorage-ng-4.2.40/storage/Devices/LvmLv.h 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/LvmLv.h 2020-01-03 17:05:56.000000000 +0100 @@ -150,6 +150,8 @@ /** * Compare (less than) two LvmLvs by lv-name. + * + * The comparison is locale unaware. */ static bool compare_by_lv_name(const LvmLv* lhs, const LvmLv* rhs); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/LvmVg.h new/libstorage-ng-4.2.44/storage/Devices/LvmVg.h --- old/libstorage-ng-4.2.40/storage/Devices/LvmVg.h 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/LvmVg.h 2020-01-03 17:05:56.000000000 +0100 @@ -193,6 +193,8 @@ /** * Compare (less than) two LvmVgs by vg-name. + * + * The comparison is locale unaware. */ static bool compare_by_vg_name(const LvmVg* lhs, const LvmVg* rhs); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/LvmVgImpl.h new/libstorage-ng-4.2.44/storage/Devices/LvmVgImpl.h --- old/libstorage-ng-4.2.40/storage/Devices/LvmVgImpl.h 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/LvmVgImpl.h 2020-01-03 17:05:56.000000000 +0100 @@ -60,7 +60,7 @@ virtual string get_displayname() const override { return get_vg_name(); } - virtual string get_sort_key() const override { return DEV_DIR "/" + vg_name; } + virtual string get_name_sort_key() const override { return DEV_DIR "/" + vg_name; } static void probe_lvm_vgs(Prober& prober); virtual void probe_pass_1a(Prober& prober) override; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/MdImpl.cc new/libstorage-ng-4.2.44/storage/Devices/MdImpl.cc --- old/libstorage-ng-4.2.40/storage/Devices/MdImpl.cc 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/MdImpl.cc 2020-01-03 17:05:56.000000000 +0100 @@ -139,10 +139,10 @@ string - Md::Impl::get_sort_key() const + Md::Impl::get_name_sort_key() const { static const vector<NameSchema> name_schemata = { - NameSchema(regex(DEV_DIR "/md([0-9]+)", regex::extended), { { 4, '0' } }) + NameSchema(regex(DEV_DIR "/md([0-9]+)", regex::extended), { { PadInfo::N1, 4 } }) }; return format_to_name_schemata(get_name(), name_schemata); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/MdImpl.h new/libstorage-ng-4.2.44/storage/Devices/MdImpl.h --- old/libstorage-ng-4.2.40/storage/Devices/MdImpl.h 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/MdImpl.h 2020-01-03 17:05:56.000000000 +0100 @@ -60,7 +60,7 @@ virtual string get_pretty_classname() const override; - virtual string get_sort_key() const override; + virtual string get_name_sort_key() const override; virtual Impl* clone() const override { return new Impl(*this); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/PartitionImpl.cc new/libstorage-ng-4.2.44/storage/Devices/PartitionImpl.cc --- old/libstorage-ng-4.2.40/storage/Devices/PartitionImpl.cc 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/PartitionImpl.cc 2020-01-03 17:05:56.000000000 +0100 @@ -90,11 +90,16 @@ string - Partition::Impl::get_sort_key() const + Partition::Impl::get_name_sort_key() const { const Partitionable* partitionable = get_partitionable(); - return partitionable->get_impl().get_sort_key() + pad_front(to_string(get_number()), 3, '0'); + string sort_key = partitionable->get_impl().get_name_sort_key(); + if (isdigit(sort_key.back())) + sort_key += 'p'; + sort_key += pad_front(to_string(get_number()), 3, '0'); + + return sort_key; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/PartitionImpl.h new/libstorage-ng-4.2.44/storage/Devices/PartitionImpl.h --- old/libstorage-ng-4.2.40/storage/Devices/PartitionImpl.h 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/PartitionImpl.h 2020-01-03 17:05:56.000000000 +0100 @@ -58,7 +58,7 @@ virtual string get_pretty_classname() const override; - virtual string get_sort_key() const override; + virtual string get_name_sort_key() const override; virtual Impl* clone() const override { return new Impl(*this); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/StrayBlkDeviceImpl.cc new/libstorage-ng-4.2.44/storage/Devices/StrayBlkDeviceImpl.cc --- old/libstorage-ng-4.2.40/storage/Devices/StrayBlkDeviceImpl.cc 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/StrayBlkDeviceImpl.cc 2020-01-03 17:05:56.000000000 +0100 @@ -57,10 +57,10 @@ string - StrayBlkDevice::Impl::get_sort_key() const + StrayBlkDevice::Impl::get_name_sort_key() const { static const vector<NameSchema> name_schemata = { - NameSchema(regex(DEV_DIR "/xvd([a-z]+)([0-9]+)", regex::extended), { { 4, ' ' }, { 3, '0' } }) + NameSchema(regex(DEV_DIR "/xvd([a-z]+)([0-9]+)", regex::extended), { { PadInfo::A1, 5 }, { PadInfo::N1, 3 } }) }; return format_to_name_schemata(get_name(), name_schemata); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Devices/StrayBlkDeviceImpl.h new/libstorage-ng-4.2.44/storage/Devices/StrayBlkDeviceImpl.h --- old/libstorage-ng-4.2.40/storage/Devices/StrayBlkDeviceImpl.h 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Devices/StrayBlkDeviceImpl.h 2020-01-03 17:05:56.000000000 +0100 @@ -53,7 +53,7 @@ virtual string get_pretty_classname() const override; - virtual string get_sort_key() const override; + virtual string get_name_sort_key() const override; virtual Impl* clone() const override { return new Impl(*this); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Utils/AppUtil.cc new/libstorage-ng-4.2.44/storage/Utils/AppUtil.cc --- old/libstorage-ng-4.2.40/storage/Utils/AppUtil.cc 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Utils/AppUtil.cc 2020-01-03 17:05:56.000000000 +0100 @@ -511,6 +511,21 @@ } + /** + * Enumerates string containing 'a' to 'z'. "a" is 1, "z" is 26, "aa" is 27 and so on. + */ + unsigned int + enumerate_strings(const string& s) + { + unsigned int i = 0; + + for (char c : s) + i = (26 * i) + (c - 'a' + 1); + + return i; + } + + string format_to_name_schemata(const string& s, const vector<NameSchema>& name_schemata) { @@ -524,10 +539,22 @@ for (size_t i = match.size() - 1; i > 0; --i) { - const pair<size_t, char>& pad_info = name_schema.pad_infos[i - 1]; + const PadInfo& pad_info = name_schema.pad_infos[i - 1]; + + string replacement; + + switch (pad_info.method) + { + case PadInfo::N1: + replacement = pad_front(match.str(i), pad_info.size, '0'); + break; + + case PadInfo::A1: + replacement = pad_front(to_string(enumerate_strings(match.str(i))), pad_info.size, '0'); + break; + } - ret.replace(match.position(i), match.length(i), - pad_front(match.str(i), pad_info.first, pad_info.second)); + ret.replace(match.position(i), match.length(i), replacement); } return ret; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Utils/AppUtil.h new/libstorage-ng-4.2.44/storage/Utils/AppUtil.h --- old/libstorage-ng-4.2.40/storage/Utils/AppUtil.h 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Utils/AppUtil.h 2020-01-03 17:05:56.000000000 +0100 @@ -136,11 +136,41 @@ /** + * Padding informations for NameSchema. + */ + struct PadInfo + { + enum Method + { + /** + * Numeric pad. The number is padded with zeros. + */ + N1, + + /** + * Alphabetical pad. The string (must only contain 'a' to + * 'z') is transformed to a number and that number is + * padded with zeros. + * + * This method should be locale invariant. E.g. simply + * padding the string with spaces is not locale invariant. + */ + A1 + }; + + PadInfo(Method method, size_t size) : method(method), size(size) {} + + const Method method; + const size_t size; + }; + + + /** * Definition of a name schema used by format_to_name_schemata(). */ struct NameSchema { - NameSchema(regex re, const vector<pair<size_t, char>>& pad_infos) + NameSchema(regex re, const vector<PadInfo>& pad_infos) : re(re), pad_infos(pad_infos) {} /** @@ -152,7 +182,7 @@ * Width and char to which the sub-matches of the regular * expression will be padded. */ - const vector<pair<size_t, char>> pad_infos; + const vector<PadInfo> pad_infos; }; @@ -163,7 +193,7 @@ * This can be used to sort device names. E.g. if it is desired to * have "sdb" before "sdaa" the names can be transformed to "sd b" * and "sdaa" and be sorted alphabetical. Used by - * Device::get_sort_key(). + * Device::get_name_sort_key(). */ string format_to_name_schemata(const string& s, const vector<NameSchema>& name_schemata); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Utils/SystemCmd.cc new/libstorage-ng-4.2.44/storage/Utils/SystemCmd.cc --- old/libstorage-ng-4.2.40/storage/Utils/SystemCmd.cc 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Utils/SystemCmd.cc 2020-01-03 17:05:56.000000000 +0100 @@ -290,22 +290,22 @@ int sout[2]; int serr[2]; bool ok = true; - if ( !_testmode && pipe(sin)<0 ) + if ( pipe(sin)<0 ) { SYSCALL_FAILED( "pipe stdin creation failed" ); ok = false; } - if ( !_testmode && pipe(sout)<0 ) + if ( pipe(sout)<0 ) { SYSCALL_FAILED( "pipe stdout creation failed" ); ok = false; } - if ( !_testmode && !_combineOutput && pipe(serr)<0 ) + if ( !_combineOutput && pipe(serr)<0 ) { SYSCALL_FAILED( "pipe stderr creation failed" ); ok = false; } - if ( !_testmode && ok ) + if ( ok ) { _pfds[0].fd = sin[1]; if ( fcntl( _pfds[0].fd, F_SETFL, O_NONBLOCK )<0 ) @@ -421,21 +421,15 @@ break; } } - else if ( !_testmode ) - { - _cmdRet = -1; - } else { - _cmdRet = 0; - y2mil("TESTMODE would execute \"" << command() << "\""); + _cmdRet = -1; } if ( _cmdRet==-127 || _cmdRet==-1 ) { y2err("system (\"" << command() << "\") = " << _cmdRet); } - if ( !_testmode ) - checkOutput(); + checkOutput(); y2mil("system() Returns:" << _cmdRet); if ( _cmdRet!=0 ) logOutput(); @@ -753,7 +747,4 @@ return ret; } - - bool SystemCmd::_testmode = false; - } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/storage/Utils/SystemCmd.h new/libstorage-ng-4.2.44/storage/Utils/SystemCmd.h --- old/libstorage-ng-4.2.40/storage/Utils/SystemCmd.h 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/storage/Utils/SystemCmd.h 2020-01-03 17:05:56.000000000 +0100 @@ -229,8 +229,6 @@ OutputProcessor* _outputProc; struct pollfd _pfds[3]; - static bool _testmode; - /** * Constructs the environment for the child process. * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/testsuite/sorting/format.cc new/libstorage-ng-4.2.44/testsuite/sorting/format.cc --- old/libstorage-ng-4.2.40/testsuite/sorting/format.cc 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/testsuite/sorting/format.cc 2020-01-03 17:05:56.000000000 +0100 @@ -14,13 +14,14 @@ BOOST_AUTO_TEST_CASE(format) { static const vector<NameSchema> name_schemata = { - NameSchema(regex("/dev/sd([a-z]+)", regex::extended), { { 4, ' ' } }), - NameSchema(regex("/dev/md([0-9]+)", regex::extended), { { 3, '0' } }), - NameSchema(regex("/dev/nvme([0-9]+)n([0-9]+)", regex::extended), { { 3, '0' }, { 3, '0' } }), - NameSchema(regex("/dev/xvd([a-z]+)([0-9]+)", regex::extended), { { 4, ' ' }, { 3, '0' } }), + NameSchema(regex("/dev/sd([a-z]+)", regex::extended), { { PadInfo::A1, 5 } }), + NameSchema(regex("/dev/md([0-9]+)", regex::extended), { { PadInfo::N1, 3 } }), + NameSchema(regex("/dev/nvme([0-9]+)n([0-9]+)", regex::extended), { { PadInfo::N1, 3 }, { PadInfo::N1, 3 } }), }; - BOOST_CHECK_EQUAL(format_to_name_schemata("/dev/sda", name_schemata), "/dev/sd a"); + BOOST_CHECK_EQUAL(format_to_name_schemata("/dev/sda", name_schemata), "/dev/sd00001"); + BOOST_CHECK_EQUAL(format_to_name_schemata("/dev/sdaa", name_schemata), "/dev/sd00027"); + BOOST_CHECK_EQUAL(format_to_name_schemata("/dev/sdaaa", name_schemata), "/dev/sd00703"); BOOST_CHECK_EQUAL(format_to_name_schemata("/dev/md", name_schemata), "/dev/md"); @@ -30,6 +31,4 @@ BOOST_CHECK_EQUAL(format_to_name_schemata("/dev/md1234", name_schemata), "/dev/md1234"); BOOST_CHECK_EQUAL(format_to_name_schemata("/dev/nvme1n2", name_schemata), "/dev/nvme001n002"); - - BOOST_CHECK_EQUAL(format_to_name_schemata("/dev/xvda1", name_schemata), "/dev/xvd a001"); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/utils/generate-catches.py new/libstorage-ng-4.2.44/utils/generate-catches.py --- old/libstorage-ng-4.2.40/utils/generate-catches.py 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/utils/generate-catches.py 2020-01-03 17:05:56.000000000 +0100 @@ -37,7 +37,7 @@ def output_class_functions(): for classname in sorted(utils.classes.nodes()): - output_functions(utils.classes.node[classname].get('functions', [])) + output_functions(utils.classes.nodes[classname].get('functions', [])) print("") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.40/utils/utils.py new/libstorage-ng-4.2.44/utils/utils.py --- old/libstorage-ng-4.2.40/utils/utils.py 2019-12-12 11:49:41.000000000 +0100 +++ new/libstorage-ng-4.2.44/utils/utils.py 2020-01-03 17:05:56.000000000 +0100 @@ -89,10 +89,10 @@ kind = node3.getAttribute("kind") if kind in ["public-func", "public-static-func", "func"]: tmp = process_functions(compound_name, node3) - if not 'functions' in classes.node[compound_name]: - classes.node[compound_name]['functions'] = tmp + if not 'functions' in classes.nodes[compound_name]: + classes.nodes[compound_name]['functions'] = tmp else: - classes.node[compound_name]['functions'] += tmp + classes.nodes[compound_name]['functions'] += tmp if compound_kind == "namespace":
