parted/parted-print-max-partitions-for-yast.patch
Arvin Schnell c34e26e7e1 Accepting request 971201 from home:aschnell:branches:Base:System
- update to version 3.5:
  * Add support for JSON output.
  * Add support for linux-home flag for GPT.
  * Add --fix option.
  added patches:
  - direct-handling-of-partition-type-id-and-uuid.patch
  - parted-json-no-type-flag.patch
  refreshed patches:
  - libparted-open-the-device-RO-and-lazily-switch-to-RW.patch
  - parted-2.4-ncursesw6.patch
  - parted-add-ignore-busy-option.patch
  - parted-fix-resizepart-and-rm-command.patch
  - parted-implement-wipesignatures-option.patch
  - parted-print-max-partitions-for-yast.patch
  - parted-type.patch
  - tests-disable.patch
  removed patches:
  - parted-escape-printed-device-path.patch
  - parted-mkpart-allow-empty-gpt-part-name.patch

OBS-URL: https://build.opensuse.org/request/show/971201
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=152
2022-04-21 05:58:32 +00:00

25 lines
1.1 KiB
Diff

From: Anna Maresova <anicka@suse.cz>
Date: Wed Mar 25 18:17:28 CET 2020
Subject: parted: print maximum number of partitions for yast
Patch-mainline: no, custom SUSE patch
Index: parted-3.3/parted/parted.c
===================================================================
--- parted-3.3.orig/parted/parted.c
+++ parted-3.3/parted/parted.c
@@ -1125,10 +1125,13 @@ _print_disk_info (const PedDevice *dev,
break;
}
- printf ("%s:%s:%s:%lld:%lld:%s:%s:%s;\n",
+ printf ("%s:%s:%s:%lld:%lld:%s:%s:%s",
escaped_path, end, transport[dev->type],
dev->sector_size, dev->phys_sector_size,
pt_name, escaped_model, disk_flags);
+ if (getenv("PARTED_PRINT_NUMBER_OF_PARTITION_SLOTS"))
+ printf(":%lld", diskp && diskp->type->ops->get_max_primary_partition_count ? diskp->type->ops->get_max_primary_partition_count(diskp) : 0);
+ printf(";\n");
free (escaped_path);
free (escaped_model);
} else if (opt_output_mode == JSON) {