[gparted] Remove backward compatibility for dmraid without -P option (#788007)



commit a89d55a6f0a8886843ba89872ef447ca38ab2be6
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Thu Sep 21 16:06:17 2017 +0100

    Remove backward compatibility for dmraid without -P option (#788007)
    
    The -P option was first added to dmraid-1.0.0.rc15 released 2006-09-17
    [1].  dmraid-1.0.0.rc16 (a later release) was included in Debian 6 and
    Ubunbu 12.04 LTS.  dmraid-1.0.0.rc13 was included in RedHat/CentOS 5
    however the -P option was back ported into RedHat/CentOS 5.1.
    
    All of these distributions are so old as to be no longer supported and
    yet they provided the dmraid -P option.  Therefore backward
    compatibility for dmraid without the -P option is no longer required.
    So remove it.
    
    [1] old dmraid source code releases
        http://people.redhat.com/heinzm/sw/dmraid/src/old/
    
    Bug 788007 - Remove minor bits of legacy from DMRaid module

 src/DMRaid.cc |   20 ++++----------------
 1 files changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/src/DMRaid.cc b/src/DMRaid.cc
index 8da4b4e..b75e5d1 100644
--- a/src/DMRaid.cc
+++ b/src/DMRaid.cc
@@ -330,16 +330,10 @@ bool DMRaid::create_dev_map_entries( const Partition & partition, OperationDetai
        operationdetail .add_child( OperationDetail( tmp ) );
 
        //Newer dmraid defaults to always inserting the letter 'p' between the device name
-       //  and the partition number.  Since the '-P' option is not valid for older dmraid
-       //  versions, try with and without the '-P' option.
+       //  and the partition number.
        command = "dmraid -ay -P \"\" -v" ;
        if ( execute_command( command, operationdetail .get_last_child() ) )
-       {
-               //Above command failed, so try without the '-P' option.
-               command = "dmraid -ay -v" ;
-               if ( execute_command( command, operationdetail .get_last_child() ) )
-                       exit_status = false ;   //command failed
-       }
+               exit_status = false;  // command failed
 
        operationdetail .get_last_child() .set_status( exit_status ? STATUS_SUCCES : STATUS_ERROR ) ;
 
@@ -354,16 +348,10 @@ bool DMRaid::create_dev_map_entries( const Glib::ustring & dev_path )
        bool exit_status = true ;
 
        //Newer dmraid defaults to always inserting the letter 'p' between the device name
-       //  and the partition number.  Since the '-P' option is not valid for older dmraid
-       //  versions, try with and without the '-P' option.
+       //  and the partition number.
        command = "dmraid -ay -P \"\" -v" ;
        if ( Utils::execute_command( command, output, error, true ) )
-       {
-               //Above command failed, so try without the '-P' option.
-               command = "dmraid -ay -v" ;
-               if ( Utils::execute_command( command, output, error, true ) )
-                       exit_status = false;    //command failed
-       }
+               exit_status = false;  // command failed
 
        return exit_status ;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]