[gparted] Stop checking for 'ntfslabel --new-serial' support



commit 1b17264603c920ce369b4fc1a4f853eb14a61643
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Mon Apr 15 07:49:05 2019 +0100

    Stop checking for 'ntfslabel --new-serial' support
    
    The oldest supported distributions have these versions of ntfs-3g /
    ntfsprogs.
    
      Distro             EOL        ntfs-3g / ntfsprogs
    - Debian 8           2020-Jun   2014.2.16AR.2
    - RHEL / CentOS 7    2024-Jun   2017.3.23
    - Ubuntu 14.04 LTS   2019-Apr   2013.1.13AR.1
    
    The oldest version of ntfs-3g / ntfsprogs on Ubuntu 14.04 LTS includes
    support for the --new-serial option.
    
        $ ntfslabel -V
    
        ntfslabel v2013.1.13AR.1 (libntfs-3g) - Display, or set, the label for an NTFS Volume.
    
        $ ntfslabel --help | grep -- --new-serial
                --new-serial   Set a new serial number
    
    Therefore it is no longer necessary to check for this option as it is
    always available.  The worst case scenario is that some how an old
    version of ntfslabel is used which doesn't support this option.  In such
    a case GParted goes from not supporting changing the UUID to claiming
    support, but presumably it would fail with an error reporting unknown
    option when applied.  Arguably better from an end user support point of
    view.

 src/ntfs.cc | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)
---
diff --git a/src/ntfs.cc b/src/ntfs.cc
index 7f4247db..844a008e 100644
--- a/src/ntfs.cc
+++ b/src/ntfs.cc
@@ -65,22 +65,11 @@ FS ntfs::get_filesystem_support()
        if (! Glib::find_program_in_path("ntfsinfo").empty())
                fs.read = FS::EXTERNAL;
 
-       if ( ! Glib::find_program_in_path( "ntfslabel" ) .empty() ) {
-               Glib::ustring version ;
-
+       if (! Glib::find_program_in_path("ntfslabel").empty())
+       {
                fs .read_label = FS::EXTERNAL ;
                fs .write_label = FS::EXTERNAL ;
-
-               //Not all versions of ntfslabel support setting the Volume Serial Number
-               //The advanced (AR) release does as of the first 2012 release
-               //The stable release does not have it yet, at the time of this writing
-               //So: check for the presence of the command-line option.
-
-               //ntfslabel --help exits with non-zero error code (1)
-               Utils::execute_command( "ntfslabel --help ", output, error, false ) ;
-
-               if ( ! ( version = Utils::regexp_label( output, "--new-serial[[:blank:]]" ) ) .empty() )
-                       fs .write_uuid = FS::EXTERNAL ;
+               fs.write_uuid = FS::EXTERNAL;
        }
 
        if ( ! Glib::find_program_in_path( "mkntfs" ) .empty() )


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