Commit 1b172646 authored by Mike Fleetwood's avatar Mike Fleetwood Committed by Curtis Gedak

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.
parent d795cccb
Pipeline #75906 passed with stages
in 17 minutes and 49 seconds
......@@ -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() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment