[gparted] Require xxd and dd for NTFS move or paste action



commit f164e78153db069c9af757391b7297152ba9c36c
Author: Curtis Gedak <gedakc gmail com>
Date:   Thu May 14 14:59:49 2009 -0600

    Require xxd and dd for NTFS move or paste action
    
    Related to GParted bug #574389
---
 README       |    2 +-
 src/Utils.cc |    2 +-
 src/ntfs.cc  |   13 ++++++++++---
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/README b/README
index da2a33f..82e0ccb 100644
--- a/README
+++ b/README
@@ -112,7 +112,7 @@ Optional packages include:
    hfsutils
    hfsprogs
    jfsutils
-   ntfsprogs       - xxd command from vim-common also required
+   ntfsprogs       - dd command, and xxd command from vim-common also required
    reiser4progs
    reiserfsprogs
    xfsprogs
diff --git a/src/Utils.cc b/src/Utils.cc
index 35d4a7f..750d3ec 100644
--- a/src/Utils.cc
+++ b/src/Utils.cc
@@ -157,7 +157,7 @@ Glib::ustring Utils::get_filesystem_software( FILESYSTEM filesystem )
 		case FS_HFSPLUS     : return "hfsprogs" ;
 		case FS_JFS         : return "jfsutils" ;
 		case FS_LINUX_SWAP  : return "util-linux" ;
-		case FS_NTFS        : return "ntfsprogs" ;
+		case FS_NTFS        : return "ntfsprogs, xxd, dd" ;
 		case FS_REISER4     : return "reiser4progs" ;
 		case FS_REISERFS    : return "reiserfsprogs" ;
 		case FS_UFS         : return "" ;
diff --git a/src/ntfs.cc b/src/ntfs.cc
index 277972f..4503744 100644
--- a/src/ntfs.cc
+++ b/src/ntfs.cc
@@ -48,12 +48,19 @@ FS ntfs::get_filesystem_support()
 		if ( fs .read ) //needed to determine a min file system size..
 			fs .shrink = GParted::FS::EXTERNAL ;
 	}
-	
+
+	//Command xxd used with dd to update NTFS boot sector after move or paste.
+	//  See GParted_Core::update_bootsector().
+
 	//we need ntfsresize to set correct used/unused after cloning
-	if ( ! Glib::find_program_in_path( "ntfsclone" ) .empty() )
+	if ( ! Glib::find_program_in_path( "ntfsclone" ) .empty() &&
+	     ! Glib::find_program_in_path( "xxd" ) .empty() &&
+	     ! Glib::find_program_in_path( "dd" ) .empty() )
 		fs .copy = GParted::FS::EXTERNAL ;
 
-	if ( fs .check )
+	if ( fs .check && 
+	     ! Glib::find_program_in_path( "xxd" ) .empty() &&
+	     ! Glib::find_program_in_path( "dd" ) .empty() )
 		fs .move = GParted::FS::GPARTED ;
 	
 	return fs ;



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