From 548641bb02fce454d756e3a530462e8117228039 Mon Sep 17 00:00:00 2001 From: Mattia Verga Date: Nov 16 2014 13:29:21 +0000 Subject: Backport upstream patch to fix detection of devices without partition table. --- diff --git a/kde-partitionmanager-no_table_fix.patch b/kde-partitionmanager-no_table_fix.patch new file mode 100644 index 0000000..c05c853 --- /dev/null +++ b/kde-partitionmanager-no_table_fix.patch @@ -0,0 +1,88 @@ +diff -U 3 -H -d -r -N -- a/src/plugins/libparted/libpartedbackend.cpp b/src/plugins/libparted/libpartedbackend.cpp +--- a/src/plugins/libparted/libpartedbackend.cpp 2014-07-09 13:41:51.000000000 +0200 ++++ b/src/plugins/libparted/libpartedbackend.cpp 2014-11-16 14:16:16.506336734 +0100 +@@ -49,11 +49,6 @@ + #include + #include + +-#include +-#include +-#include +-#include +- + #include + #include + #include +@@ -441,62 +436,23 @@ + return d; + } + +-static quint32 countDevices(const QList& driveList) +-{ +- quint32 rval = 0; +- +- foreach(const Solid::Device& solidDevice, driveList) +- { +- (void) solidDevice; // Silence compiler warning. +-#ifndef ENABLE_UDISKS2 +- const Solid::StorageDrive* solidDrive = solidDevice.as(); +- if (solidDrive->driveType() == Solid::StorageDrive::HardDisk || +- solidDrive->driveType() == Solid::StorageDrive::CompactFlash || +- solidDrive->driveType() == Solid::StorageDrive::MemoryStick || +- solidDrive->driveType() == Solid::StorageDrive::SmartMedia || +- solidDrive->driveType() == Solid::StorageDrive::SdMmc || +- solidDrive->driveType() == Solid::StorageDrive::Xd) +-#endif +- rval++; +- } +- return rval; +-} +- + QList LibPartedBackend::scanDevices() + { + QList result; + +- const QList driveList = getSolidDeviceList(); +- const quint32 totalDevices = countDevices(driveList); +- +- quint32 count = 0; +- +- foreach(const Solid::Device& solidDevice, driveList) ++ ped_device_probe_all(); ++ PedDevice* pedDevice = NULL; ++ while (true) + { +-#ifndef ENABLE_UDISKS2 +- const Solid::StorageDrive* solidDrive = solidDevice.as(); +- +- if (solidDrive->driveType() != Solid::StorageDrive::HardDisk && +- solidDrive->driveType() != Solid::StorageDrive::CompactFlash && +- solidDrive->driveType() != Solid::StorageDrive::MemoryStick && +- solidDrive->driveType() != Solid::StorageDrive::SmartMedia && +- solidDrive->driveType() != Solid::StorageDrive::SdMmc && +- solidDrive->driveType() != Solid::StorageDrive::Xd) ++ pedDevice = ped_device_get_next(pedDevice); ++ if (!pedDevice) ++ break; ++ if (pedDevice->type == PED_DEVICE_DM) + continue; +-#endif +- +- const Solid::Block* solidBlock = solidDevice.as(); +- +- Device* d = scanDevice(solidBlock->device()); +- kWarning() << solidBlock->device(); +- +- if (d != NULL) +- { +- d->setIconName(solidDevice.icon()); ++ QString path = QString::fromUtf8(pedDevice->path); ++ Device* d = scanDevice(path); ++ if (d) + result.append(d); +- } +- +- emitScanProgress(solidBlock->device(), (++count) * 100 / totalDevices); + } + + return result; diff --git a/kde-partitionmanager.spec b/kde-partitionmanager.spec index 9fff3a7..4a1097d 100644 --- a/kde-partitionmanager.spec +++ b/kde-partitionmanager.spec @@ -3,7 +3,7 @@ Name: kde-partitionmanager Version: 1.1.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: KDE Partition Manager License: GPLv2+ @@ -18,6 +18,11 @@ Source0: http://download.kde.org/stable/partitionmanager/%{version}/src/p Source1: kdepm-generate-tarball.sh # Source built using the following commands : sh kdepm-generate-tarball.sh 20130815 +# Backport git commit 30d8f841ed96b85056f0dd996c57eedc7646ca2f +# to fix detection of devices without partition table +# https://bugzilla.redhat.com/show_bug.cgi?id=1086351 +Patch0: kde-partitionmanager-no_table_fix.patch + BuildRequires: parted-devel, libblkid-devel, libatasmart-devel, kdelibs4-devel, gettext, cmake, desktop-file-utils Requires: parted, e2fsprogs # Require kde-filesystem @@ -38,6 +43,9 @@ to make use of all features and get full support for all file systems. %prep %setup -q -n partitionmanager-%{version} + +%patch0 -p1 + ## Due to the name change ## this is already under kde4/ subdir, no need to change further imho -- rex %if 0%{?fedora} && 0%{?fedora} < 21 @@ -91,6 +99,9 @@ fi %{_datadir}/appdata/partitionmanager.appdata.xml %changelog +* Sun Nov 16 2014 Mattia Verga - 1.1.0-3 +- Fix detection of devices without partition table + * Sat Aug 16 2014 Fedora Release Engineering - 1.1.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild